Color::Add

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

Add combines two colors by taking the clamped sum of each channel (c1 + c2). For Color objects, the actual equation used for each 8 bit channel is: min(c1+c2, 255).

Parameters
Parameters 
Description 
Color c1 
The first (the destination) of two color parameters that is summed to form a new color (return value). * 
Color c2 
The second (the source) of two color parameters that is summed to form a new color (return value). * 
Color c 
A color (the source) added to the current color (the destination). 
Return Value

The member function, taking one parameter (c), returns a Color reference to the current string, which was formed by adding the passed color to the original color (this + c). 

The static function, taking two parameters (c1 and c2), returns a new Color by value, which is formed from the summation of the two passed colors (c1 + c2). * 

*- pertains to static function only. 

See Also