Description
The Color.Max
method is a static method that returns a new Color
instance representing the maximum color values between two given colors. It compares each component (red, green, blue, and alpha) of the two colors and selects the maximum value for each component to form the resulting color.
Usage
To use the Color.Max
method, pass two Color
references as parameters. The method will return a new Color
object with the maximum component values from the two input colors.
Example
Color color1 = new Color(0.5f, 0.2f, 0.3f, 1.0f);
Color color2 = new Color(0.3f, 0.4f, 0.6f, 0.8f);
Color maxColor = Color.Max(ref color1, ref color2);
// maxColor will have the values (0.5f, 0.4f, 0.6f, 1.0f)