Class HclColor
Contains helper-methods and extension for the Color-type to work in the Hcl color space.
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public static class HclColor
Methods
| Edit this page View SourceAddHcl(in Color, float, float, float)
Adds the specified Hcl values to this color.
Declaration
public static Color AddHcl(this in Color color, float h = 0, float c = 0, float l = 0)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | h | The H value to add. |
float | c | The c value to add. |
float | l | The l 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 Hcl-Values.
Declaration
public static Color Create(byte alpha, float h, float c, float l)
Parameters
Type | Name | Description |
---|---|---|
byte | alpha | The alphc component value of this Color. |
float | h | The H component value of this Color. |
float | c | The c component value of this Color. |
float | l | The l 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 Hcl-Values.
Declaration
public static Color Create(int alpha, float h, float c, float l)
Parameters
Type | Name | Description |
---|---|---|
int | alpha | The alphc component value of this Color. |
float | h | The H component value of this Color. |
float | c | The c component value of this Color. |
float | l | The l 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 Hcl-Values.
Declaration
public static Color Create(float h, float c, float l)
Parameters
Type | Name | Description |
---|---|---|
float | h | The H component value of this Color. |
float | c | The c component value of this Color. |
float | l | The l 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 Hcl-Values.
Declaration
public static Color Create(float alpha, float h, float c, float l)
Parameters
Type | Name | Description |
---|---|---|
float | alpha | The alphc component value of this Color. |
float | h | The H component value of this Color. |
float | c | The c component value of this Color. |
float | l | The l component value of this Color. |
Returns
Type | Description |
---|---|
Color | The color created from the values. |
DivideHcl(in Color, float, float, float)
Divides the specified Hcl values to this color.
Declaration
public static Color DivideHcl(this in Color color, float h = 1, float c = 1, float l = 1)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | h | The H value to divide. |
float | c | The c value to divide. |
float | l | The l value to divide. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
GetHcl(in Color)
Gets the H, c and l component values (Hcl-color space) of this Color. H in the range [0..360]. c in the range [0..1]. l in the range [0..1].
Declaration
public static (float h, float c, float l) GetHcl(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 H, c and l component value of the color. |
GetHclC(in Color)
Gets the c component value (Hcl-color space) of this Color in the range [0..1].
Declaration
public static float GetHclC(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
float | The c component value of the color. |
GetHclH(in Color)
Gets the H component value (Hcl-color space) of this Color in the range [0..360].
Declaration
public static float GetHclH(this in Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to get the value from. |
Returns
Type | Description |
---|---|
float | The H component value of the color. |
GetHclL(in Color)
Gets the l component value (Hcl-color space) of this Color in the range [0..1].
Declaration
public static float GetHclL(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. |
MultiplyHcl(in Color, float, float, float)
Multiplies the specified Hcl values to this color.
Declaration
public static Color MultiplyHcl(this in Color color, float h = 1, float c = 1, float l = 1)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | h | The H value to multiply. |
float | c | The c value to multiply. |
float | l | The l value to multiply. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
SetHcl(in Color, float?, float?, float?)
Sets the specified X value of this color.
Declaration
public static Color SetHcl(this in Color color, float? h = null, float? c = null, float? l = null)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float? | h | The H value to set. |
float? | c | The c value to set. |
float? | l | The l value to set. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |
SubtractHcl(in Color, float, float, float)
Subtracts the specified Hcl values to this color.
Declaration
public static Color SubtractHcl(this in Color color, float h = 0, float c = 0, float l = 0)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to modify. |
float | h | The H value to subtract. |
float | c | The c value to subtract. |
float | l | The l value to subtract. |
Returns
Type | Description |
---|---|
Color | The new color after the modification. |