ahex
Alpha hexadecimal
Install
npm install -S ahex
Usage
const ahex = ; // RGB formatconsole;// rgb(0, 255, 0) // RGBA formatconsole;// rgba(0, 255, 0, 0.87) // RGBAA formatconsole;// rgba(0, 255, 0, 0.87) // RRGGBB formatconsole;// rgba(0, 255, 0) // RRGGBBA formatconsole;// rgba(0, 255, 0, 0.87) // RRGGBBAA formatconsole;// rgba(0, 255, 0, 0.87)
if the second parameter is set to true
the returned result will be an object
console;// { r: 0, g: 255, b: 0, a: '0.87' }