colormin

Turn a CSS color into its smallest representation.
Install
With npm do:
npm install colormin --save
Example
var colormin = require('colormin');
console.log(colormin('rgba(255, 0, 0, 1)'));
colormin works for rgb, rgba, hsl, hsla, hex & css color keywords. See more
example output in the tests. Note that colormin does not convert
invalid CSS colors; it is not a color validator itself.
Contributing
Pull requests are welcome. If you add functionality, then please add unit tests
to cover it.
License
MIT © Ben Briggs