xtd 0.2.0
Loading...
Searching...
No Matches

◆ average() [1/2]

static color xtd::drawing::color::average ( const color color1,
const color color2,
double  weight 
)
staticnoexcept

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
Returns
The average color.
Remarks
The alpha of color1 is conserved.
The red, green and blue values are averages using the following formula:
color = color1 * (1 - weight) + color2 * weight;
Represents an ARGB (alpha, red, green, blue) color.
Definition color.h:49
Thus, a weight value of 1.0 will return the second color, while a value of 0.0 will return the first color.
Deprecated:
Replaced by xtd::drawing::color_converter::average - Will be removed in version 0.4.0