@tempots/color

HSLuv class

Represents a color in the HSLuv color space.

Signature:

declare class HSLuv 

Constructors

Constructor

Modifiers

Description

(constructor)(hue, saturation, lightness)

Constructs a new instance of the HSLuv class

Properties

Property

Modifiers

Type

Description

equals

readonly

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

Checks if the current HSLuv object is equal to another HSLuv object.

fromString

static

readonly

(s: string) => HSLuv

Creates a new HSLuv color instance from a string representation. The string should be in the format "hsluv(h, s%, l%)".

hue

readonly

number

The hue value of the color in degrees.

lightness

readonly

number

The lightness value of the color in the HSLuv color space.

ofChannels

static

readonly

([hue, saturation, lightness]: [hue: number, saturation: number, lightness: number]) => HSLuv

Creates a new HSLuv color instance from the given channel values.

saturation

readonly

number

The saturation value of the color in the HSLuv color space.

toChannels

readonly

() => [number, number, number]

Converts the HSLuv color to an array of channels.

toString

readonly

() => string

Returns a string representation of the HSLUV color in the format "hsluv(hue, saturation%, lightness%)"

withHue

readonly

(hue: number) => HSLuv

Returns a new HSLuv instance with the specified hue value.

withLightness

readonly

(lightness: number) => HSLuv

Returns a new HSLuv color with the specified lightness.

withSaturation

readonly

(saturation: number) => HSLuv

Returns a new HSLuv instance with the specified saturation value.