Korona
Take any JavaScript data and get back a reasonably unique hex or rgb color with an optional alpha channel 🖌
Usage
Korona is just a function.
const korona = ; ;// => '#abcdef' [some hex value]
Korona takes an optional options hash as the second argument:
const korona = ; ;// => '#abcdef' [default mode is hex];// => 'rgb(1, 2, 3)' [the same hex value, but in RGB format];// => '#abcdef01' [by default, alpha is false]// alpha: true will add a fourth, alpha channel to both the hex and rgb modes.
The two options can obviously be combined:
;// => 'rgba(1, 2, 3, 0.4)'
License
MIT. See LICENSE
.