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) Version: 11.3.999
public readonly struct HslColor : IEquatable<HslColor>
Inheritance
Object    ValueType    HslColor
Implements
IEquatableHslColor

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 ValueTypeEquals(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 ValueTypeGetHashCode)
GetTypeGets 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.
ToStringReturns the fully qualified type name of this instance.
(Overrides ValueTypeToString)
TryParse(String, HslColor) Parses an HSL color string.

Operators

Equality(HslColor, HslColor) Indicates whether the values of two specified HslColor objects are equal.
(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.

See Also