1.0.1 • Published 5 years ago

color-spacer v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

color-spacer

Utility for generating evenly-spaced colors around an HSV color wheel.

const { getColors } = require('./dist/index.js');

getColors(6); // [ '#ff0000', '#ffff00', '#00ff00', '#00ffff', '#0000ff', '#ff00ff' ]
getColors(3); // [ '#ff0000', '#00ff00', '#0000ff' ]
getColors(3, { shift: Math.PI / 6 }); // [ '#ffff00', '#00ffff', '#ff00ff' ]
getColors(3, { s: 0.5 }); // [ '#ff8080', '#80ff80', '#8080ff' ]
getColors(3, { v: 0.5 }); // [ '#800000', '#008000', '#000080' ]