A color generator for JavaScript. There are lots of clever one-liners for generating random colors. Unfortunately, this code naturally produces murky greys, browns and greens. randomColor generates attractive colors by default. More specifically, randomColor produces bright colors with a reasonably high saturation. This makes randomColor particularly useful for data visualizations and generative art. Once you’ve included randomColor.js on your page, calling randomColor() will return a random attractive color. Beneath is the output of randomColor called 54 times. You can also pass an options object to randomColor. This allows you to specify the hue, luminosity and the number of colors to generate.
Features
- See the demo for an explanation and some samples
- To use randomColor in the browser, download the latest minified version of randomColor
- To use randomColor on the server with node.js, install randomColor from npm
- You can pass an options object to influence the type of color it produces
- Control the hue of the generated color
- Control the luminosity of the generated color