bx_color bx_blend_color ( bx_color  c1,
double  alpha,
bx_color  c2 
)

Computes an approximation of the color c of an alpha-weighted blend of two colors c1 and c2, that is if c1=(r1,g1,b1) and c2=(r2,g2,b2) as (Red,Green,Blue) triplets, then c=(r1+(r2-r1)*alpha, g1+(g2-g1)*alpha, b1+(b2-b1)*alpha) for some given alpha in the range (0.0, 1.0).

Parameters:
c1 the first color.
c2 the second color.
alpha a blending coefficient in the range (0.0, 1.0).
Returns:
the blend of c1 and c2 by coefficient alpha.
Remarks:
  • for alpha=0.0, c= c1.
  • for alpha=1.0, c= c2.
  • for alpha=0.5, c= bx_mean_color(c1,c2).


Generated on Fri Oct 10 00:01:00 2008 for bx-lib : the Basic X11 Library tuned for C beginners by  doxygen 1.5.6