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;color;color; color;color;color; color;color;color; color;color; color;color;
Getter/setter notation
var c = color; c; c; // should return 0.5
toArray
var c = color; c; // [1, 0, 0, 1]
toHex
var c = color; c; // 'ff0000'
toCSS
var c = color;c; // 'rgb(255,0,0)' c;c; // 'rgba(255,0,0,0.5)'
Chaining
var c = color; c; // chains c; // [0.5, 0.5, 0, 1]
Bounds
var c = color; c; // [1, 0, 1, 0]
Type conversions
var c1 = color;var c2 = color; c2; // [0, 1, 1, 1]
Other libraries
See https://github.com/bebraw/jswiki/wiki/Color-libraries .
License
colorjs is available under MIT license. See LICENSE for more details.