Table of Contents

Struct CieLab

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

Represents a CIE Lab* 1976 color. https://en.wikipedia.org/wiki/Lab_color_space

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

Constructors

CieLab(Vector3)

Initializes a new instance of the CieLab struct.

public CieLab(Vector3 vector)

Parameters

vector Vector3

The vector representing the l, a, b components.

Remarks

Uses DefaultWhitePoint as white point.

CieLab(Vector3, CieXyz)

Initializes a new instance of the CieLab struct.

public CieLab(Vector3 vector, CieXyz whitePoint)

Parameters

vector Vector3

The vector representing the l, a, b components.

whitePoint CieXyz

The reference white point. Illuminants

CieLab(float, float, float)

Initializes a new instance of the CieLab struct.

public CieLab(float l, float a, float b)

Parameters

l float

The lightness dimension.

a float

The a (green - magenta) component.

b float

The b (blue - yellow) component.

Remarks

Uses DefaultWhitePoint as white point.

CieLab(float, float, float, CieXyz)

Initializes a new instance of the CieLab struct.

public CieLab(float l, float a, float b, CieXyz whitePoint)

Parameters

l float

The lightness dimension.

a float

The a (green - magenta) component.

b float

The b (blue - yellow) component.

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

A

Gets the a color component. A value usually ranging from -100 to 100. Negative is green, positive magenta.

public float A { get; }

Property Value

float

B

Gets the b color component. A value usually ranging from -100 to 100. Negative is blue, positive is yellow

public float B { get; }

Property Value

float

L

Gets the lightness dimension. A value usually 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(CieLab)

public bool Equals(CieLab other)

Parameters

other CieLab

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 ==(CieLab, CieLab)

Compares two CieLab objects for equality.

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

Parameters

left CieLab

The CieLab on the left side of the operand.

right CieLab

The CieLab on the right side of the operand.

Returns

bool

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

operator !=(CieLab, CieLab)

Compares two CieLab objects for inequality

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

Parameters

left CieLab

The CieLab on the left side of the operand.

right CieLab

The CieLab on the right side of the operand.

Returns

bool

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