Struct Hsl
- Namespace
- SixLabors.ImageSharp.ColorSpaces
- Assembly
- SixLabors.ImageSharp.dll
Represents a Hsl (hue, saturation, lightness) color.
public readonly struct Hsl : IEquatable<Hsl>
- Implements
- Inherited Members
Constructors
Hsl(Vector3)
Initializes a new instance of the Hsl struct.
public Hsl(Vector3 vector)
Parameters
vector
Vector3The vector representing the h, s, l components.
Hsl(float, float, float)
Initializes a new instance of the Hsl struct.
public Hsl(float h, float s, float l)
Parameters
h
floatThe h hue component.
s
floatThe s saturation component.
l
floatThe l value (lightness) component.
Properties
H
Gets the hue component.
public float H { get; }
Property Value
L
Gets the lightness component.
public float L { get; }
Property Value
S
Gets the saturation component.
public float S { get; }
Property Value
Methods
Equals(Hsl)
public bool Equals(Hsl other)
Parameters
other
Hsl
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(Hsl, Hsl)
Compares two Hsl objects for equality.
public static bool operator ==(Hsl left, Hsl right)
Parameters
left
HslThe Hsl on the left side of the operand.
right
HslThe Hsl on the right side of the operand.
Returns
- bool
True if the current left is equal to the
right
parameter; otherwise, false.
operator !=(Hsl, Hsl)
Compares two Hsl objects for inequality.
public static bool operator !=(Hsl left, Hsl right)
Parameters
left
HslThe Hsl on the left side of the operand.
right
HslThe Hsl on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
right
parameter; otherwise, false.