Show / Hide Table of Contents

Class HclColor

Contains helper-methods and extension for the Color-type to work in the Hcl color space.

Inheritance
object
HclColor
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public static class HclColor

Methods

| Edit this page View Source

AddHcl(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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX