Table of Contents

Struct CieLch

Namespace
SixLabors.ImageSharp.ColorSpaces
Assembly
SixLabors.ImageSharp.dll

Represents the CIE LCh°, cylindrical form of the CIE Lab* 1976 color. https://en.wikipedia.org/wiki/Lab_color_space#Cylindrical_representation:_CIELCh_or_CIEHLC

public readonly struct CieLch : IEquatable<CieLch>
Implements
Inherited Members

Constructors

CieLch(Vector3)

Initializes a new instance of the CieLch struct.

public CieLch(Vector3 vector)

Parameters

vector Vector3

The vector representing the l, c, h components.

Remarks

Uses DefaultWhitePoint as white point.

CieLch(Vector3, CieXyz)

Initializes a new instance of the CieLch struct.

public CieLch(Vector3 vector, CieXyz whitePoint)

Parameters

vector Vector3

The vector representing the l, c, h components.

whitePoint CieXyz

The reference white point. Illuminants

CieLch(float, float, float)

Initializes a new instance of the CieLch struct.

public CieLch(float l, float c, float h)

Parameters

l float

The lightness dimension.

c float

The chroma, relative saturation.

h float

The hue in degrees.

Remarks

Uses DefaultWhitePoint as white point.

CieLch(float, float, float, CieXyz)

Initializes a new instance of the CieLch struct.

public CieLch(float l, float c, float h, CieXyz whitePoint)

Parameters

l float

The lightness dimension.

c float

The chroma, relative saturation.

h float

The hue in degrees.

whitePoint CieXyz

The reference white point. Illuminants

Fields

DefaultWhitePoint

D50 standard illuminant. Used when reference white is not specified explicitly.

public static readonly CieXyz DefaultWhitePoint

Field Value

CieXyz

Properties

C

Gets the a chroma component. A value ranging from 0 to 200.

public float C { get; }

Property Value

float

H

Gets the h° hue component in degrees. A value ranging from 0 to 360.

public float H { get; }

Property Value

float

L

Gets the lightness dimension. A value ranging between 0 (black), 100 (diffuse white) or higher (specular white).

public float L { get; }

Property Value

float

WhitePoint

Gets the reference white point of this color

public CieXyz WhitePoint { get; }

Property Value

CieXyz

Methods

Equals(CieLch)

public bool Equals(CieLch other)

Parameters

other CieLch

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Saturation()

Computes the saturation of the color (chroma normalized by lightness)

public float Saturation()

Returns

float

The float

Remarks

A value ranging from 0 to 100.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CieLch, CieLch)

Compares two CieLch objects for equality.

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

Parameters

left CieLch

The CieLch on the left side of the operand.

right CieLch

The CieLch on the right side of the operand.

Returns

bool

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

operator !=(CieLch, CieLch)

Compares two CieLch objects for inequality

public static bool operator !=(CieLch left, CieLch right)

Parameters

left CieLch

The CieLch on the left side of the operand.

right CieLch

The CieLch on the right side of the operand.

Returns

bool

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