Converts a CSS hex color code to RGBA values
npm install --save @chriscodesthings/css-hex-color-to-rgba
import hexColorToRGBA from '@chriscodesthings/css-hex-color-to-rgba';
console.log(hexColorToRGBA("#6495ed"));
// => [ 100, 149, 237 ]
hexColorToRGBA(col);
- col: a CSS hex color code
Array containing the R, G, B and A values of col.
Converts a CSS hex color to RGBA values.
- R, G, and B range from 0 to 255
- A ranges from 0 to 1
Accepts CSS hex color codes in any form.