hexToHSL(hex: string): Array<number>
Parses a hex RGB(A) color code into a HSL(A) array.
Examples
Parsing a long form RGBA hex code with alpha:
const hex = '#FF000069' // Red const hsl = hexToHSL(hex) console.debug(hsl) // [ 0 , 100 , 50 , 69 ]
Parsing a short form RGB hex code without #:
const hex = 'F00' // Red const hsl = hexToHSL(hex) console.debug(hsl) // [ 0 , 100 , 50 ]
hex: string
Hex RGB(A) color code string.