colorAverage

fnuint colorAverage(uint c1, uint c2, float weight) nothrow @nogc

Averages two colors together.

Returns a color that is a weighted average of the two input colors. A weight of 1.0 returns c1, a weight of 0.0 returns c2.

Parameters

c1First color
c2Second color
weightWeight of first color (0.0 to 1.0)

Returns

Averaged color value

Example:

// Get a color halfway between red and blue
uint purple = colorAverage(Colors.RED, Colors.BLUE, 0.5);