Table of Contents

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 Vector3

The 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 float

The h hue component.

s float

The s saturation component.

l float

The l value (lightness) component.

Properties

H

Gets the hue component. A value ranging between 0 and 360.

public float H { get; }

Property Value

float

L

Gets the lightness component. A value ranging between 0 and 1.

public float L { get; }

Property Value

float

S

Gets the saturation component. A value ranging between 0 and 1.

public float S { get; }

Property Value

float

Methods

Equals(Hsl)

public bool Equals(Hsl other)

Parameters

other Hsl

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Hsl, Hsl)

Compares two Hsl objects for equality.

public static bool operator ==(Hsl left, Hsl right)

Parameters

left Hsl

The Hsl on the left side of the operand.

right Hsl

The 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 Hsl

The Hsl on the left side of the operand.

right Hsl

The Hsl on the right side of the operand.

Returns

bool

True if the current left is unequal to the right parameter; otherwise, false.