Build up a css string from color values
npm install color-stringify$ npm install color-stringify
js
var stringify = require('color-stringify');
stringify([120,100,100,.4], 'hsl'); //hsla(120, 100%, 100%, .4)
`
API
$3
is an array or an object from css-parse
is an optional string:
* [x] 'hex' — #RRGGBB or #RGB if possible.
* [x] 'keyword' — red, see the list of supported names.
* [x] 'percent' — rgb(10%, 20%, 30%, 0.1).
* [x] 'adobe1' — R:0, G:0, B:0.
* [x] 'adobe2' — (R0 / G0 / B0).
* [ ] 'websafe' — request feature.
* [ ] 'pantone' — request feature.
* [x] undefined — rgba(10, 20, 30, 0.2).
* [x] Any other string —