Skip to content
party.js logoparty.js logo

ReferenceUtilitiesInterface

Color

A color in the Oklab color space.

A color in the Oklab color space, which party.js uses internally because it is perceptually uniform. Gradients blend evenly, and lighting changes brightness without shifting the hue.

You rarely need to build one by hand: You can pass a CSS color string to color(), or anywhere that accepts colors, instead.

anumber

Position on the green (negative) to red (positive) axis, about -0.3 to 0.3 for screen colors.

alphanumber

Opacity, from 0 (transparent) to 1 (opaque).

bnumber

Position on the blue (negative) to yellow (positive) axis, about -0.3 to 0.3 for screen colors.

lnumber

Perceived lightness, from 0 (black) to 1 (white).