Skip to content

hsvToHSL

Converts HSV to HSL by routing through RGB.

Importing

ts
import { hsvToHSL } from '@basmilius/utils';

Usage

ts
import { hsvToHSL } from '@basmilius/utils';

hsvToHSL(0.589, 1, 0.952);
// => [h, s, l] with h in 0..360, s and l in 0..100

Parameters

NameTypeDescription
hnumberHue as a fraction, 0..1 (multiply by 360 for degrees).
snumberSaturation as a fraction, 0..1.
vnumberValue as a fraction, 0..1.

Returns

[number, number, number][h, s, l] with h in 0..360, s and l in 0..100, matching the rgbToHSL output range.

Type signature

ts
declare function hsvToHSL(h: number, s: number, v: number): [number, number, number];

See also