Skip to content
Simple color generation tool.
CSS JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Color Generator

Perhaps the easiest way to find your next favorite color.

How to Use

Find a color is easy. For those of you on traditional computers and laptops, press spacebar to generate a random color. If you're using a touch device, you can simply tap your screen.

If you go too fast, and pass by a color that may have been a keeper, simply use your back key to view previously generated colors. Use the forward key to go the other direction.

Notes of Potential Interest

The text color is determined by calculating the WCAG contrast ratio of the randomly-generated color against both black and white, and choosing whichever ratio is higher (more contrast).

Both ratios are compared to see if they meet the minimum contrast ratio of 4.5.

It would be great to not only compare these two pre-determined colors, but instead generate a text color that has an even more ideal ratio (somewhere over 7 for smaller text).

You can’t perform that action at this time.