color-system
v0.1.0
Published
transfer colors between color systems
Downloads
8
Readme
color-system
Convert and compute in color systems (RGB, HSV, HSL, LAB, XYZ, LCH)
usage
in node.js
npm install color-system
in browsers
wget https://raw.github.com/tmcw/color-system/master/colorsystem.js
api
hsv(rgb) -> hsv
hsv.invert(hsv) -> rgb
hsl(rgb) -> hsl
hsl.invert(hsl) -> rgb
hue(rgb) -> hue
saturation(rgb) -> saturation
lightness(rgb) -> lightness
example
var colorsys = require('color-system');
colorsys.hsl([0, 0, 0]); // [r, g, b] => [h, s, l]
colorsys.hsv([0, 0, 0]); // [r, g, b] => [h, s, v]
development
build docs & standalone for browsers:
npm run-script make
see also
'full solutions'
- Style.js
- color-convert (js)
- chroma.js (coffee)
- chromatist (coffee)
- ColorMine
'modules'
why
'Why write yet another JavaScript color library?'
- This is written in vanilla, idiomatic JavaScript
- It aims to be literate like simple-statistics and to remove and explain the 'magic numbers' that rule color math
- This aims to do just color systems - other concerns in other modules