Description
The Luminance
property of the Color
struct returns the luminance of the color, which is essentially its grayscale value or the "black and white version" of the color. This property is useful for determining the brightness of a color without considering its hue or saturation.
Usage
To access the luminance of a Color
object, simply use the Luminance
property. This property is read-only and returns a float
value representing the luminance.
Example
Color color = new Color(0.5f, 0.5f, 0.5f, 1.0f);
float luminance = color.Luminance;
// Use the luminance value for further processing or analysis