rgbToHSL(rgb: Array<number>): Array<number>
Converts RGB(A) color arrays to HSL(A) color arrays.
Examples
Conversion without alpha channel:
const rgb = [ 255 , 0 , 0 ] // Red const hsl = rgbToHSL(rgb) console.debug(hsl) // [ 0 , 100 , 50 ]
Conversion with alpha channel:
const rgba = [ 255 , 0 , 0 , 69 ] // Green const hsl = rgbToHSL(rgba) console.debug(hsl) // [ 120 , 100 , 50 , 69 ]