Random Color Palette Generator, Press Space, Free
Press the space bar to draw a random color palette in your browser. Lock the colors you like, edit any hex code, check contrast, and export CSS, JSON or a PNG strip. Nothing is uploaded.
Or press the space bar. Locked swatches stay.
rgb(157, 13, 151)
hsl(303, 85%, 33%)
- On white7.14:1AAA
- On black2.93:1Fail
rgb(26, 226, 226)
hsl(180, 79%, 49%)
- On white1.61:1Fail
- On black13.02:1AAA
rgb(100, 201, 36)
hsl(97, 70%, 46%)
- On white2.11:1Fail
- On black9.92:1AAA
rgb(194, 72, 149)
hsl(322, 50%, 52%)
- On white4.51:1AA
- On black4.65:1AA
rgb(132, 109, 48)
hsl(44, 47%, 35%)
- On white4.98:1AA
- On black4.21:1AA Large
About the Random Color Palette generator
Sometimes you have no starting colour and just want ideas. The Random Color Palette generator draws five fresh colours each time you press the space bar. This page opens the same tool as the Color Palette Generator, set to the Random scheme, so there is nothing to type. Keep the swatches you like, replace the rest, and repeat until a set feels right.
The palette is made in your browser. Nothing is uploaded, and no account is needed.
How to use it
Steps
- Press the space bar, or the New palette button, to draw five new colours.
- Press Lock on any swatch you want to keep.
- Press the space bar again. Locked swatches stay, and the others change.
- Type into a swatch's Hex code field to adjust a colour by hand.
- Use Copy CSS, Copy JSON, Download SVG or Download PNG when you are done.
The space bar works whenever no button or text field has focus. If you have just typed in a field, click on the page background first.
What random means here
A fully random colour is often dull or too dark to use. Each colour in this tool is drawn within limits on the HSL scale:
- Hue: any value from 0 to 360 degrees
- Saturation: 40 to 90 %
- Lightness: 30 to 75 %
In symbols, with three fresh random numbers between 0 and 1, one colour is
For example , , gives , and , a medium teal.
Hue is unrestricted, so every part of the wheel can appear. The saturation floor of 40 % rules out greys, and the lightness range of 30 to 75 % rules out near-black and near-white. A lightness of 30 % still gives a deep colour, while 75 % gives a light one that is not washed out.
Why locking helps
Searching for a good palette is easier when you do not lose the good parts. Say the first draw gives one swatch you love. Lock it, then draw again and again until the other four suit it. The locked colour never changes, and neither does a swatch you have edited by hand and locked.
The same holds if you switch to another scheme. Choosing, say, Triadic brings back the Base colour field, and locked swatches keep their colours while the rest follow the scheme.
Editing a swatch
Each card has an editable Hex code. Type #ff6347 and the swatch becomes tomato, which is rgb(255, 99, 71). A valid colour applies at once. Invalid text shows a message beside the field and the swatch stays as it was. The card also shows rgb() and hsl() text and a Copy #rrggbb button.
Is it readable?
Every swatch shows a contrast ratio and a WCAG badge On white and On black. The ratio is , using the lighter and darker luminance, and white on black scores 21:1. Badges read AAA from 7:1, AA from 4.5:1, AA Large from 3:1 and Fail below. Use them to see which swatches can carry text.
Using the result
The page address records the colours (as ?colors= followed by hex codes without #), so copying it saves a palette you like. Open it later and the same colours return.
To turn a favourite swatch into a themed set, copy its hex code into the base field of the Color Scheme Generator. To pick colours from a photo rather than at random, use the Color Extractor or the Average Color Finder.
Frequently asked questions
How do I get a new random palette?
Press the space bar or the New palette button. The space bar works only when no button or text field has focus, so click the page background first if you have been typing.
How do I keep a colour I like?
Press Lock on its swatch. Locked swatches keep their colour when you draw a new palette, so only the unlocked ones change.
Why are the random colours never grey or very dark?
Each colour is drawn with a saturation of 40 to 90 percent and a lightness of 30 to 75 percent. That excludes greys, near-black and near-white, while any hue from 0 to 360 degrees can appear.
Can I change a swatch by hand?
Yes. Type a valid colour into its Hex code field and the swatch changes at once. If the text is not a valid colour, a message appears and nothing changes.
Can I get back a palette I liked?
Yes, if you copied the page address. It records the colours as ?colors= followed by hex codes, so opening it again shows the same palette. Without that address a random draw cannot be repeated.
Is the palette uploaded or stored?
No. The colours are drawn in your browser and nothing is uploaded or saved on a server. The only record is the page address, which holds the colours and scheme.