The Color.Average
method calculates the average color from an array of Color
objects. This method is useful when you need to blend multiple colors together to find a mean color value.
The Color.Average
method calculates the average color from an array of Color
objects. This method is useful when you need to blend multiple colors together to find a mean color value.
To use the Color.Average
method, pass an array of Color
objects as the parameter. The method will return a new Color
object representing the average of the input colors.
// Example usage of Color.Average Color[] colors = new Color[] { new Color(1.0f, 0.0f, 0.0f), // Red new Color(0.0f, 1.0f, 0.0f), // Green new Color(0.0f, 0.0f, 1.0f) // Blue }; Color averageColor = Color.Average(colors); // averageColor will be a blend of red, green, and blue.