Skip to content

Function: hexToHsl()

ts
function hexToHsl(hex): HslColor;

Converts a hex color string directly to an HslColor object.

Parameters

ParameterType
hexstring

Returns

HslColor

Example

ts
hexToHsl('#ff6600') // => { h: 24, s: 100, l: 50, a: 1 }

Since

1.0.0

Released under the MIT License.