HslColor Structure
Defines a color using the hue/saturation/lightness (HSL) model. This uses a cylindrical-coordinate representation of a color.
Definition
Namespace: Avalonia.Media
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public readonly struct HslColor : IEquatable<HslColor>
Public Structure HslColor
Implements IEquatable(Of HslColor)
[<SealedAttribute>]
type HslColor =
struct
inherit ValueType
interface IEquatable<HslColor>
end
| Inheritance | Object → ValueType → HslColor |
| Implements | IEquatable(HslColor) |
Constructors
| HslColor(Color) | Initializes a new instance of the HslColor struct. |
| HslColor(Double, Double, Double, Double) | Initializes a new instance of the HslColor struct. |
Properties
| A | Gets the Alpha (transparency) component in the range from 0..1 (percentage). |
| H | Gets the Hue component in the range from 0..360 (degrees). This is the color's location, in degrees, on a color wheel/circle from 0 to 360. Note that 360 is equivalent to 0 and will be adjusted automatically. |
| L | Gets the Lightness component in the range from 0..1 (percentage). |
| S | Gets the Saturation component in the range from 0..1 (percentage). |
Methods
| Equals(HslColor) | Indicates whether the current object is equal to another object of the same type. |
| Equals(Object) | Indicates whether this instance and a specified object are equal. (Overrides ValueType.Equals(Object)) |
| FromAhsl(Double, Double, Double, Double) | Creates a new HslColor from individual color component values. |
| FromHsl(Double, Double, Double) | Creates a new HslColor from individual color component values. |
| GetHashCode() | Gets a hashcode for this object. Hashcode is not guaranteed to be unique. (Overrides ValueType.GetHashCode()) |
| GetType() | Gets the Type of the current instance. (Inherited from Object) |
| Parse(String) | Parses an HSL color string. |
| ToHsv() | Returns the HSV color model equivalent of this HSL color. |
| ToHsv(Double, Double, Double, Double) | Converts the given HSLA color component values to their HSV color equivalent. |
| ToRgb() | Returns the RGB color model equivalent of this HSL color. |
| ToRgb(Double, Double, Double, Double) | Converts the given HSLA color component values to their RGB color equivalent. |
| ToString() | Returns the fully qualified type name of this instance. (Overrides ValueType.ToString()) |
| TryParse(String, HslColor) | Parses an HSL color string. |
Operators
| Equality(HslColor, HslColor) | Indicates whether the values of two specified HslColor objects are equal. |
| Explicit(HslColor to Color) | Explicit conversion from an HslColor to a Color. |
| Inequality(HslColor, HslColor) | Indicates whether the values of two specified HslColor objects are not equal. |