Struct Hsl
Represents a Hsl (hue, saturation, lightness) color.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.ColorSpaces
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct Hsl : IEquatable<Hsl>
Constructors
| Edit this page View SourceHsl(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. |
Hsl(float, float, float)
Initializes a new instance of the Hsl struct.
Declaration
public Hsl(float h, float s, float l)
Parameters
Type | Name | Description |
---|---|---|
float | h | The h hue component. |
float | s | The s saturation component. |
float | l | The l value (lightness) component. |
Properties
| Edit this page View SourceH
Gets the hue component.
Declaration
public float H { get; }
Property Value
Type | Description |
---|---|
float |
L
Gets the lightness component.
Declaration
public float L { get; }
Property Value
Type | Description |
---|---|
float |
S
Gets the saturation component.
Declaration
public float S { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceEquals(Hsl)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Hsl other)
Parameters
Type | Name | Description |
---|---|---|
Hsl | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
Operators
| Edit this page View Sourceoperator ==(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 |
---|---|
bool | True if the current left is equal to the |
operator !=(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 |
---|---|
bool | True if the current left is unequal to the |