HSLtoRGB

Color
stable

Convert an HSL colour (hue, saturation, lightness) to sRGB. Implemented as HSLtoHSV followed by HSVtoRGB.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

hsla
required
THSLA
Colour in HSL space with optional alpha. h in [0, 360], s and l in [0, 1], a in [0, 1].

API

Return value

The value returned by this util.

Equivalent sRGB colour object with r, g, b in [0, 255] and optional a in [0, 1].

Usage

Examples

Ready-to-paste usage snippets.

Convert green HSL to RGB

typescript