Description
The Color32.Max
method is a static method that returns a new Color32
instance representing the maximum color values between two given Color32
instances. This method compares each color component (red, green, blue, and alpha) of the two input colors and selects the maximum value for each component to form the resulting color.
Usage
Use the Color32.Max
method when you need to determine the maximum color values between two Color32
instances. This can be useful in scenarios where you want to blend colors by taking the brightest components from each color.
Example
Color32 color1 = new Color32 { r = 100, g = 150, b = 200, a = 255 };
Color32 color2 = new Color32 { r = 120, g = 140, b = 180, a = 255 };
Color32 maxColor = Color32.Max(color1, color2);
// maxColor will have r = 120, g = 150, b = 200, a = 255