Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

color-generator

0.1.0 • Public • Published

color-generator

Generates colors based on the golden ratio, inspired by Martin Ankerl's blog post. The generated colors are more visually pleasing together than a simple random color generator because they are computed by moving around the color wheel in increments of the golden ratio. By default, the generated colors can used as a background for legible black text, but the color generator can be customized for other uses.

Returns color objects so you can convert the colors to any colorspace or CSS string representation easily.

Example

var gen = require('color-generator');
 
// see https://github.com/harthur/color for docs on conversions
gen().hexString() // '#BF79F2'
gen().rgbString() // 'rgb(242, 226, 121)'
 
// provide custom saturation and brightness
gen(0.8, 0.25).hexString() // '#0D1C40'

License

MIT

Install

npm i color-generator

DownloadsWeekly Downloads

649

Version

0.1.0

License

MIT

Last publish

Collaborators

  • avatar