Color::SubtractRGB

Color::SubtractRGB
static inline Color SubtractRGB(Color c1, Color c2);
inline Color& SubtractRGB(Color c);
Description

SubtractRGB combines two colors by taking the alpha components of the first color and the clamped difference of the RGB channels (c1.rgb - c2.rgb). For Color objects, the actual equation used for each of the 8 bit channels is: max(c1.rgb - c2.rgb, 0).

Parameters
Parameters 
Description 
Color c1 
The first (the destination) of two color parameters whose alpha component is set directly to the new color, while its RGB channels are combined with the second color's RGB channels to form the new color (return value). * 
Color c2 
The second (the source) of two color parameters whose RGB channels are combined with the first color's channels to form the new color (return value). * 
Color c 
A color (the source) whose RGB channels are subtracted from the RGB channels of the current color (the destination). The current colors alpha component is not affected. 
Return Value

The member function, taking one parameter (c), returns a Color reference to the current string, which was formed by subtracting the RGB channels of the passed color from the original color (this.rgb - c.rgb). 

The static function, taking two parameters (c1 and c2), returns a new Color by value, which is formed from the first color's alpha component and the difference of the two color's RGB channels ((c1.rgb - c2.rgb), c1.a). * 

* - pertains to static function only. 

See Also