Extension Method in Mixing


public static Color Mix<T>(this Color color, Color other, float weight = 0.5F, bool mixAlpha = true)
    where T : struct, IComponentModel


Returns the result of mixing the color with another color using a weight between [0..1]. A weight of 0 results in the first color, and a weight of 1 results in the second color.

Type Parameters

TThe type of component model to use.


colorThe first color to mix.
otherThe second color to mix.
weightThe weight of the color mix between [0..1] (default=0.5).
mixAlphaTrue to mix the alpha components, otherwise the alpha is unchanged (default=true).


ColorThe result of mixing the two colors.