HSLtoHSV

Color
stable

Convert an HSL colour (hue, saturation, lightness) to HSV (hue, saturation, value). Both representations span the same visible gamut; HSV is more convenient for colour-picker math.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

hsl
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 colour in HSV space. h in [0, 360], s and v in [0, 1], a preserved.

Usage

Examples

Ready-to-paste usage snippets.

Convert HSL to HSV

typescript