Class LabColor
Contains helper-methods and extension for the Color-type to work in the Lab color space.
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public static class LabColor
Methods
| Edit this page View SourceAddLab(in Color, float, float, float)
Adds the specified Lab values to this color.
Declaration
public static Color AddLab(this in Color color, float l = 0, float a = 0, float b = 0)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | l | The L value to add. |
float | a | The a value to add. |
float | b | The b value to add. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
Create(byte, float, float, float)
Creates a new instance of the Color struct using alpha and Lab-Values.
Declaration
public static Color Create(byte alpha, float l, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
byte | alpha | The alpha component value of this Color. |
float | l | The L component value of this Color. |
float | a | The a component value of this Color. |
float | b | The b component value of this Color. |
Returns
Type | Description |
---|---|
Color | The color created from the values. |
Create(int, float, float, float)
Creates a new instance of the Color struct using alpha and Lab-Values.
Declaration
public static Color Create(int alpha, float l, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
int | alpha | The alpha component value of this Color. |
float | l | The L component value of this Color. |
float | a | The a component value of this Color. |
float | b | The b component value of this Color. |
Returns
Type | Description |
---|---|
Color | The color created from the values. |
Create(float, float, float)
Creates a new instance of the Color struct using Lab-Values.
Declaration
public static Color Create(float l, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
float | l | The L component value of this Color. |
float | a | The a component value of this Color. |
float | b | The b component value of this Color. |
Returns
Type | Description |
---|---|
Color | The color created from the values. |
Create(float, float, float, float)
Creates a new instance of the Color struct using alpha and Lab-Values.
Declaration
public static Color Create(float alpha, float l, float a, float b)
Parameters
Type | Name | Description |
---|---|---|
float | alpha | The alpha component value of this Color. |
float | l | The L component value of this Color. |
float | a | The a component value of this Color. |
float | b | The b component value of this Color. |
Returns
Type | Description |
---|---|
Color | The color created from the values. |
DivideLab(in Color, float, float, float)
Divides the specified Lab values to this color.
Declaration
public static Color DivideLab(this in Color color, float l = 1, float a = 1, float b = 1)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | l | The L value to divide. |
float | a | The a value to divide. |
float | b | The b value to divide. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
GetLab(in Color)
Gets the L, a and b component values (Lab-color space) of this Color. L in the range [0..100]. a in the range [0..1]. b in the range [0..1].
Declaration
public static (float l, float a, float b) GetLab(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
(float r, float g, float b) | A tuple containing the L, a and b component value of the color. |
GetLabA(in Color)
Gets the a component value (Lab-color space) of this Color in the range [0..1].
Declaration
public static float GetLabA(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
float | The a component value of the color. |
GetLabB(in Color)
Gets the b component value (Lab-color space) of this Color in the range [0..1].
Declaration
public static float GetLabB(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
float | The b component value of the color. |
GetLabL(in Color)
Gets the L component value (Lab-color space) of this Color in the range [0..100].
Declaration
public static float GetLabL(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
float | The L component value of the color. |
MultiplyLab(in Color, float, float, float)
Multiplies the specified Lab values to this color.
Declaration
public static Color MultiplyLab(this in Color color, float l = 1, float a = 1, float b = 1)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | l | The L value to multiply. |
float | a | The a value to multiply. |
float | b | The b value to multiply. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
SetLab(in Color, float?, float?, float?)
Sets the specified X valueof this color.
Declaration
public static Color SetLab(this in Color color, float? l = null, float? a = null, float? b = null)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float? | l | The L value to set. |
float? | a | The a value to set. |
float? | b | The b value to set. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
SubtractLab(in Color, float, float, float)
Subtracts the specified Lab values to this color.
Declaration
public static Color SubtractLab(this in Color color, float l = 0, float a = 0, float b = 0)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | l | The L value to subtract. |
float | a | The a value to subtract. |
float | b | The b value to subtract. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |