colorjs
colorjs provides simple API that may be used to create colors (RGBA, HSVA, HSLA) and perform various color related operations (conversions and such).
Examples
Making red (#FF0000)
color.rgba('red');
color.rgba('#FF0000');
color.rgba('FF0000');
color.hsva('red');
color.hsva('#FF0000');
color.hsva('FF0000');
color.hsla('red');
color.hsla('#FF0000');
color.hsla('FF0000');
color.rgba({r: 1});
color.hsva({s: 1, v: 1});
color.rgba().r(1);
color.hsva().s(1).v(1);
Getter/setter notation
var c = color.rgba('red');
c.r(0.5);
c.r();
toArray
var c = color.rgba('red');
c.toArray();
toHex
var c = color.rgba('red');
c.toHex();
toCSS
var c = color.rgba('red');
c.toCSS();
c.a(0.5);
c.toCSS();
Chaining
var c = color.rgba('red');
c.r(0.5).b(0.5);
c.toArray();
Bounds
var c = color.hsva({h: 10, s: -10, v: 5, a: -2});
c.toArray();
Type conversions
var c1 = color.rgba('red');
var c2 = color.hsva(c1);
c2.toArray();
Other libraries
See https://github.com/bebraw/jswiki/wiki/Color-libraries .
License
colorjs is available under MIT license. See LICENSE for more details.