Skip to content

Types

HslObj

An HSL object that represents a color in the HSLA (Hue, Saturation, Lightness, Alpha) color space.

KeyDescriptionTypeValid range
hHue (color tone)number[0; 360]
sSaturation (color intensity)number[0; 1]
lLightness (brightness)number[0; 1]
aAlpha channel (opacity)number[0; 1]

Type Definition

type HslObj = {
h: number;
s: number;
l: number;
a: number;
};

RgbObj

An RGB object that represents a color in the RGBA (Red, Green, Blue, Alpha) color space.

KeyDescriptionTypeValid range
rRednumber[0; 255]
gGreennumber[0; 255]
bBluenumber[0; 255]
aAlpha channel (opacity)number[0; 1]

Type Definition

type RgbObj = {
r: number;
g: number;
b: number;
a: number;
};