Mixing.Mix<T>

Extension Method in Mixing

Declaration

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

Description

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.

Parameters

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).

Returns

ColorThe result of mixing the two colors.