Skip to content

Color

Defined in: color.ts:90

new Color(input): Color

Defined in: color.ts:109

constructor

string | number[] | RGBA | Color

Color

get rgb(): RGBA

Defined in: color.ts:137

RGBA

  • the color

set rgb(obj): void

Defined in: color.ts:148

RGBA

the color

void


get valid(): boolean

Defined in: color.ts:130

true if this is a valid color

boolean

alpha(a): Color

Defined in: color.ts:236

Set alpha

number

the alpha [0..1]

Color


clearer(ratio): Color

Defined in: color.ts:246

Make clearer

number

ratio [0..1]

Color


clone(): Color

Defined in: color.ts:227

Clone

Color


darken(ratio): Color

Defined in: color.ts:302

Darken

number

ratio [0..1]

Color


desaturate(ratio): Color

Defined in: color.ts:322

Desaturate

number

ratio [0..1]

Color


greyscale(): Color

Defined in: color.ts:256

Convert to grayscale

Color


hexString(): string

Defined in: color.ts:164

hex string

string


hslString(): string

Defined in: color.ts:172

hsl(a) string

string


interpolate(color, t): Color

Defined in: color.ts:216

Interpolate a color value between this and color

Color

number

0..1

Color


lighten(ratio): Color

Defined in: color.ts:292

Lighten

number

ratio [0..1]

Color


mix(color, weight?): Color

Defined in: color.ts:190

Mix another color to this color.

Color

Color to mix in

number = 0.5

0..1

Color


negate(): Color

Defined in: color.ts:279

Negates the rgb value

Color


oklchString(): string

Defined in: color.ts:180

oklch string

string


opaquer(ratio): Color

Defined in: color.ts:269

Opaquer

number

ratio [0..1]

Color


rgbString(): string

Defined in: color.ts:156

rgb(a) string

string


rotate(deg): Color

Defined in: color.ts:332

Rotate

number

degrees to rotate

Color


saturate(ratio): Color

Defined in: color.ts:312

Saturate

number

ratio [0..1]

Color