color-scheme.js Fork me on GitHub

color-scheme.js

Generate nice, pretty color schemes with JavaScript.

Example

scm = new ColorScheme;
scm.from_hue(21)
   .scheme('triade')
   .distance(0.1)
   .add_complement(false)
   .variation('pastel')
   .web_safe(true);

var colors = scm.colors();

console.log(colors);

# [ 'ff9966', '996633', 'ffcccc', 'cc6633', '669966', '339966', 'ccffcc', '33cc99', '339999', '339966', 'ccffcc', '33cc99' ]

Try it!

Hue
 
Hex
(Note: this functions a bit differently from setting the hue above; it will create a custom variation "preset" that differs from any of the below options)
 
Scheme
 
Distance
(won't affect mono or contrast)
 
Variation
 
Web Safe
 

Generated Colors

 

Todo

The code is translated but all the docs and tests need to be written/copied. Hang tight!