Skip to content

Home

HSL to array

Converts an hsl() color string to an array of values.

const toHSLArray = hslStr => hslStr.match(/\d+/g).map(Number);

toHSLArray('hsl(50, 10%, 10%)'); // [50, 10, 10]

More like this

Start typing a keyphrase to see matching snippets.