Nonconformist Propaganda Machine
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    color-systempublic

    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

    install

    npm i color-system

    Downloadsweekly downloads

    0

    version

    0.1.0

    license

    BSD

    last publish

    collaborators

    • avatar