Color Space : 1.2 : 2012.09.01 : http://mudcu.be ---------------------------------------------------- RGBA <-> HSLA <-> W3 RGBA <-> HSVA RGBA <-> CMY <-> CMYK RGBA <-> HEX24 <-> W3 RGBA <-> HEX32 RGBA <-> W3 ---------------------------------------------------- Examples ---------------------------------------------------- Color.Space(0x99ff0000, "HEX32>RGBA>HSLA>W3"); // outputs "hsla(60,100%,17%,0.6)" Color.Space(0xFF0000, "HEX24>RGB>HSL"); // convert HEX24 to HSL object. Color.Space("hsla(120, 100%, 50%, 1)", "W3>HSLA"); // convert W3 string to HSLA object. ---------------------------------------------------- W3 values ---------------------------------------------------- rgb(255,0,0) rgba(255,0,0,1) rgb(100%,0%,0%) rgba(100%,0%,0%,1) hsl(120, 100%, 50%) hsla(120, 100%, 50%, 1) #000000
Sugarbits/Color.Space.js
:rainbow: Library to convert between color spaces: HEX, RGB, RGBA, HSL, HSLA, CMY, CMYK. This covers the conversion between W3 compatible colors. Conversion is versatile accepting strings, arrays, and objects.
JavaScriptMIT