ColorHelper Class
Definition
Contains helpers useful when working with colors.
public class ColorHelper
Methods
| Name | Description |
|---|---|
| GetRelativeLuminance | Gets the relative (perceptual) luminance/brightness of the given color. 1 is closer to white while 0 is closer to black. |
| ToDisplayName | Determines an approximate display name for the given color. |
GetRelativeLuminance Method
Gets the relative (perceptual) luminance/brightness of the given color. 1 is closer to white while 0 is closer to black.
public double GetRelativeLuminance(Avalonia.Media.Color color)
Parameters
color Avalonia.Media.Color
The color to calculate relative luminance for.
Returns
double
The relative (perceptual) luminance/brightness of the given color.
ToDisplayName Method
Determines an approximate display name for the given color.
public string ToDisplayName(Avalonia.Media.Color color)
Parameters
color Avalonia.Media.Color
The color to get the display name for.
Returns
string
The approximate color display name.
Properties
| Name | Description |
|---|---|
| ToDisplayNameExists | Determines if color display names are supported based on the current thread culture. |
ToDisplayNameExists Property
Determines if color display names are supported based on the current thread culture.
public bool ToDisplayNameExists { get; set; }
Remarks
Only English names are currently supported following known color names. In the future known color names could be localized.