@tempots/color

LCH class

Represents a color in the LCH color space.

Signature:

declare class LCH 

Constructors

Constructor

Modifiers

Description

(constructor)(luminance, chroma, hue)

Creates a new instance of the LCH color.

Properties

Property

Modifiers

Type

Description

chroma

readonly

number

The chroma value of the LCH color.

equals

readonly

(other: LCH, tollerance?: number) => boolean

Checks if the LCH color is equal to another LCH color.

hue

readonly

number

The hue value of the LCH color.

luminance

readonly

number

The luminance value of the color in the LCH color space.

ofChannels

static

readonly

([l, c, h]: [l: number, c: number, h: number]) => LCH

toChannels

readonly

() => [number, number, number]

Converts the LCH color to an array of channels.

toString

readonly

() => string

Returns a string representation of the LCH color.

withChroma

readonly

(c: number) => LCH

Creates a new LCH color with the specified chroma value.

withHue

readonly

(h: number) => LCH

Sets the hue value of the LCH color and returns a new LCH color instance.

withLightness

readonly

(l: number) => LCH

Returns a new LCH color with the specified lightness value.