Struct Hsl
Represents a Hsl (hue, saturation, lightness) color.
Implements
Namespace: SixLabors.ImageSharp.ColorSpaces
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct Hsl
Constructors
| Improve this Doc View SourceHsl(Single, Single, Single)
Initializes a new instance of the Hsl struct.
Declaration
public Hsl(float h, float s, float l)
Parameters
Type | Name | Description |
---|---|---|
Single | h | The h hue component. |
Single | s | The s saturation component. |
Single | l | The l value (lightness) component. |
Hsl(Vector3)
Initializes a new instance of the Hsl struct.
Declaration
public Hsl(Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | The vector representing the h, s, l components. |
Properties
| Improve this Doc View SourceH
Gets the hue component.
Declaration
public readonly float H { get; }
Property Value
Type | Description |
---|---|
Single |
L
Gets the lightness component.
Declaration
public readonly float L { get; }
Property Value
Type | Description |
---|---|
Single |
S
Gets the saturation component.
Declaration
public readonly float S { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceEquals(Hsl)
Declaration
public readonly bool Equals(Hsl other)
Parameters
Type | Name | Description |
---|---|---|
Hsl | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Nullable<Object>)
Declaration
public override readonly bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Object> | obj |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
ToString()
Declaration
public override readonly string ToString()
Returns
Type | Description |
---|---|
String |
Operators
| Improve this Doc View SourceEquality(Hsl, Hsl)
Compares two Hsl objects for equality.
Declaration
public static bool operator ==(Hsl left, Hsl right)
Parameters
Type | Name | Description |
---|---|---|
Hsl | left | The Hsl on the left side of the operand. |
Hsl | right | The Hsl on the right side of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is equal to the |
Inequality(Hsl, Hsl)
Compares two Hsl objects for inequality.
Declaration
public static bool operator !=(Hsl left, Hsl right)
Parameters
Type | Name | Description |
---|---|---|
Hsl | left | The Hsl on the left side of the operand. |
Hsl | right | The Hsl on the right side of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is unequal to the |