Convert and compute in color systems
Branch: gh-pages
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
test
.gitignore
.travis.yml
LICENSE
README.md
colorsystem.js
index.js
package.json

README.md

Build Status

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'

'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