Blend combines two colors by taking the sum of each channel scaled by the alpha factor (c2 * (1-f) + c1 * f). Unlike the BlendDest and BlendSource methods, the Blend function takes the alpha factor as a passed parameter. For Color objects, the actual equation used for each 8 bit channel is: (((c1+1)*f)>>8)+(((c2+1)*(255-f))>>8).
Parameters |
Description |
Color c1 |
The first (the destination) of two color parameters that is combined to form a new color (return value). * |
Color c2 |
The second (the source) of two color parameters that is combined to form a new color (return value). * |
UByte factor |
An alpha value that is used as the factor ("f") in the blend operation. |
Color c |
A color (the source) alpha blended into the current color (the destination). |
The member function, taking one parameter (c), returns a Color reference to the current string, which was formed by alpha blending the passed color with the original color (c * (1-f) + this * f).
The static function, taking two parameters (c1 and c2), returns a new color by value, which is formed by alpha blending the two colors using the factor (c2 * (1-f) + c1 * f). *
*- pertains to static function only.