static Color Max( Color& a, Color& b )

book_4_sparkGenerated
code_blocksInput

Description

The Color.Max method is a static method that returns a new Color instance. This method compares two Color instances, a and b, and returns a new Color where each component (red, green, blue, and alpha) is the maximum value of the corresponding components from the two input colors.

Usage

To use the Color.Max method, you need to 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 usage:

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

In this example, maxColor will have the values (0.5f, 0.4f, 0.6f, 1.0f).

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 be (0.5f, 0.4f, 0.6f, 1.0f)