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

◆ average() [2/2]

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

Returns the weighted average color between the two given colors.

Parameters
color1The first color.
color2The second color.
weightThe weighting factor
average_alphaif true alpha was compute to; otherwise the alpha result is the alpha of color1
Returns
The average color.
Remarks
The alpha, 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 first color, while a value of 0.0 will return the second color.
Deprecated:
Replaced by xtd::drawing::color_converter::average - Will be removed in version 0.4.0