How to use the Random Color Generator
- 1
Choose a style
Any colour, pastel, vivid, dark or a harmonious palette.
- 2
Generate
Press the button or the spacebar for five new colours.
- 3
Lock favourites
Locked swatches stay put while the others change.
- 4
Copy codes
Click a single code, or copy all five HEX values at once.
Features
Controlled randomness
Each style limits saturation and lightness to a defined range.
Harmony mode
Five hues built from one random base: same, ±30° and two near-complements.
Per-swatch locks
Build a palette around one colour you already like.
Readable labels
Code text switches between dark and white based on the swatch’s luminance.
Click to copy
Every HEX, RGB and HSL code is a copy button.
Fair hues
Hues are drawn evenly from 0–359° with a cryptographic generator.
Who uses it — and for what
Designers
Break out of habitual colour choices.
Developers
Quick placeholder colours for charts and mock-ups.
Artists
Random palettes as a creative challenge.
Teachers
Explain HEX, RGB and HSL with live examples.
How to use it
Press Generate or the spacebar for five new colours. Click 🔒 on any swatch to lock it, so it stays while the others change — the quickest way to build a palette around one colour you already like. Click a HEX, RGB or HSL code to copy it. Styles narrow the randomness: pastel keeps colours light and soft, vivid fully saturated, dark deep and moody, and harmonious builds analogous and complementary colours around a random base hue.
Colour codes explained
HEX (#4F46E5) is the standard for web design and most design tools. RGB gives red, green and blue values from 0 to 255. HSL describes hue (0–360° around the colour wheel), saturation and lightness, which is the easiest format for making a colour lighter or darker in CSS. Each swatch shows its name text in black or white, whichever has better contrast, so you can judge readability at a glance. Use the Color Converter to convert a specific colour.
What each style actually picks
| Style | Saturation | Lightness | Feel |
|---|---|---|---|
| Any colour | 0–100% | 10–90% | Anything, including greys |
| Pastel | 55–84% | 78–87% | Soft, light, airy |
| Vivid | 85–99% | 48–57% | Bold, punchy |
| Dark | 40–79% | 15–29% | Deep, moody |
| Harmonious | 55–84% | 35–78%, stepped | Related hues, light-to-dark |
Hue is random in every style except harmonious, where all five hues are tied to one base. Because HSL values are whole numbers, two clicks giving exactly the same colour is very unlikely.
Turning random colours into a usable palette
- Give colours jobs. A common rule of thumb is roughly 60% neutral or background colour, 30% secondary and 10% accent. Pick the accent first and lock it.
- Check text contrast. Swatch labels only switch between dark and white by a simple luminance threshold, so always test real text and background pairs in the Contrast Checker: 4.5:1 for body text, 3:1 for large text.
- Check colour blindness. Red–green pairs can look alike to many people; preview with the Color Blindness Simulator and never rely on colour alone to carry meaning.
- Expand it. Turn a keeper into tints and shades with the Color Palette Generator.
Worked examples
Reading one swatch
hsl(210, 70%, 50%) converts to rgb(38, 128, 217) and #2680D9, a medium blue. Its relative luminance is about 0.21, so white text on it has a contrast ratio of about 4.1:1 — just under the 4.5:1 that WCAG asks for normal-size body text, but fine for large headings.
How harmony mode builds a palette
If the random base hue is 200° (a sky blue), the five swatches get hues 200°, 230°, 170°, 20° and 350°: the base, two neighbours 30° either side, the complement opposite it on the wheel, and a colour 150° away. Lightness steps up from about 35% to about 78% across the five swatches, so the palette runs from deep to light.
Pro tips
- Lock a brand colour, switch to Harmonious and keep pressing Space — only the unlocked swatches change.
- HSL is easiest to tweak by hand: change only the last number to make a colour lighter or darker without shifting its hue.
Glossary
- Hue
- The position on the colour wheel, in degrees from 0 (red) through 120 (green) and 240 (blue).
- Saturation
- How intense a colour is, from grey (0%) to fully saturated (100%).
- Relative luminance
- How bright a colour appears to the eye, used to calculate contrast ratios.
Frequently asked questions
How do I keep a colour?
Click the lock icon on its swatch before generating again.
Can I copy the whole palette?
Yes — “Copy all HEX” copies all five codes.
Are the colours truly random?
Yes, within the style you choose.
Why does the spacebar sometimes not work?
It is ignored while a text box, dropdown or button has focus, so the key can do its normal job there. Click an empty part of the page and try again.
Do locked colours survive a style change?
Yes. Changing the style regenerates only the unlocked swatches.
Are the colours web-safe?
They are standard sRGB HEX colours that every modern browser and design tool understands; the old 216-colour “web-safe” palette is no longer needed.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Random & Fun (18 tools)