@tempots/color

LAB class

Represents a color in the CIELAB color space.

Signature:

declare class LAB 

Constructors

Constructor

Modifiers

Description

(constructor)(lightness, a, b)

Constructs an LAB color instance.

Properties

Property

Modifiers

Type

Description

a

readonly

number

b

readonly

number

equals

readonly

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

Compares this LAB color to another for equality, within a tolerance.

fromString

static

readonly

(s: string) => LAB

Creates an LAB color instance from a string representation.

lightness

readonly

number

ofChannels

static

readonly

([lightness, a, b]: [lightness: number, a: number, b: number]) => LAB

Creates an LAB color instance from individual channel values.

toChannels

readonly

() => [number, number, number]

Returns the LAB color as an array of its components.

toString

readonly

() => string

Returns a string representation of the LAB color.

withA

readonly

(a: number) => LAB

Returns a new LAB instance with the specified a component.

withB

readonly

(b: number) => LAB

Returns a new LAB instance with the specified b component.

withL

readonly

(l: number) => LAB

Returns a new LAB instance with the specified lightness.