hex-color-utils
JavaScript primitive number
between 0
( === 0x000000
) and 16777215
( === 0xffffff
) inclusive can be used as color. hex-color-utils
is the utils for it.
; ;// 16711680 (= 0xff0000) ;// 16711680 (= 0xff0000) ;// 16711680 (= 0xff0000) ;// '#ff0000' const r = 1; // 0 to 1const g = 0; // 0 to 1const b = 0; // 0 to 1;// 16711680 (= 0xff0000) ;// [ 1, 0, 0 ] const hue = 0; // 0 to 1const sat = 1; // 0 to 1const lightness = 05; // 0 to 1;// 16711680 (= 0xff0000) ;// [ 0, 1, 0.5 ] ;// true (compare with the lightness of HSL) ;// 3342336