Skip to main content

GetRelativeLuminance Method

Gets the relative (perceptual) luminance/brightness of the given color. 1 is closer to white while 0 is closer to black.

Definition​

Namespace: Avalonia.Controls.Primitives
Assembly: Avalonia.Controls.ColorPicker (in Avalonia.Controls.ColorPicker.dll)

public static double GetRelativeLuminance(
Color color
)

Parameters​

  Color
The color to calculate relative luminance for.

Return Value​

Double
The relative (perceptual) luminance/brightness of the given color.

See Also​

Reference​

ColorHelper Class
Avalonia.Controls.Primitives Namespace