RandomBasis

Colour to draw

Random Color Generator

Generate a random colour with its HEX, RGB and HSL values — or a whole palette at once.

Runs locally in your browser. Nothing you generate is ever sent to a server.

Press "Generate" to draw a colour.

Brightness

Click any swatch to copy its HEX code.

About this random color generator

Press Generate and a colour appears with its swatch, its closest common name, and its HEX, RGB and HSL values. Every colour is drawn from the full range of 16,777,216 possible values, so you get genuinely unexpected shades rather than the same handful of presets.

HEX, RGB and HSL

All three describe the same colour in different ways. HEX is the six-character form used in CSS and design tools. RGB gives the red, green and blue channels from 0 to 255, which is what image editors expect. HSL gives hue, saturation and lightness — the easiest form to adjust by hand, because nudging the lightness keeps the same colour family. Click any code to copy just that one.

Building a palette

Raise the quantity to draw up to 24 colours at once and they appear as a grid of swatches. This suits mood boards, chart colours and picking a starting point for a brand palette. Copy All takes every HEX code in one go, one per line, ready to paste into a stylesheet or a design file.

Light, mid and dark

Fully random colours are useful for inspiration but awkward when the colour has a job to do. The brightness filter narrows the draw by lightness: light colours for backgrounds that still take dark text, dark colours for text and strong accents, mid tones for illustrations and charts. The filter applies before the draw, so within the band every colour still has an equal chance.

Colour names

Each result is matched to the nearest of fifty common colour names by comparing the red, green and blue channels. The name is a description rather than an exact label — two very different shades can both sit closest to "Teal" — but it makes results far easier to talk about than a string of hex digits.

Common uses

How the randomness works

A colour is a number between 0 and 16,777,215, and that number is drawn using your browser's cryptographic random source. Values that would fall outside a clean multiple of the range are discarded and redrawn, so no part of the spectrum is quietly favoured — a check across the hue wheel confirms the draws land evenly in all twelve segments.

How do I generate a random color?

Press Generate and a colour appears with its swatch, name, HEX, RGB and HSL values. Press again for another one.

Can I generate a whole palette at once?

Yes. Set how many colours you want, up to 24, and they are drawn together as a palette you can copy in one go.

How do I copy the HEX code?

Click any swatch and its HEX code is copied to your clipboard. Copy All takes every code in the palette at once, one per line.

Can I get light or dark colours only?

Yes. The brightness buttons limit the draw to light, mid or dark colours, which helps when you need a readable background or a strong accent.

What do HEX, RGB and HSL mean?

They are three ways of writing the same colour. HEX is used in CSS and design tools, RGB gives the red, green and blue channels, and HSL gives hue, saturation and lightness, which is easier to adjust by hand.

Is the colour actually random?

Yes. Each colour is drawn from all 16,777,216 possible values using your browser's cryptographic random source, with rejection sampling so no shade is favoured.