Description
Returns the luminance of the color, which is essentially its grayscale value or the "black and white version" of the color. Luminance is a measure of the intensity of light emitted from a surface, and in the context of colors, it represents how bright a color appears.
Usage
The Luminance
property is a read-only property of the Color
struct. It provides a single float
value representing the luminance of the color. This property is useful when you need to determine the brightness of a color or convert it to a grayscale representation.
Example
// Example of accessing the Luminance property
Color color = new Color(0.5f, 0.5f, 0.5f, 1.0f);
float luminance = color.Luminance;
// luminance will hold the grayscale value of the color