By Chris Coyier on August 20, 2015 in Web Design

David Merfield:

There are lots of clever one-liners for generating random colors:

'#' + Math.floor(Math.random()*16777215).toString(16);

Unfortunately, this code naturally produces lots of greys and browns and murky 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.

Direct Link to ArticlePermalink

randomColor is a post from CSS-Tricks