How the color generator works
The generator picks 1 to 10 random colors at once and shows each in three formats: HEX (#3A7BD5), RGB (58, 123, 213) and HSL (hue, saturation, lightness). Click a swatch to copy its HEX code.
Color formats — which to use
| Format | Example | Where it’s used |
|---|---|---|
| HEX | #3A7BD5 | CSS, design tools, most software |
| RGB | rgb(58, 123, 213) | CSS, screens, graphics software |
| HSL | hsl(215, 65%, 53%) | CSS — easy to make lighter or darker shades |
Convert between formats with the HEX / RGB / HSL converter.
Building a palette from random colors
- Pick one color you like and add shades with similar saturation — in HSL, mostly change the lightness.
- Text needs strong contrast with its background. WCAG recommends a contrast ratio of at least 4.5:1.
- Shuffle a few times — the generator is good for breaking habits and finding inspiration.
Frequently asked questions
How do I copy a color code?
Click the swatch — the HEX code goes to your clipboard. RGB and HSL are shown below it.
How many HEX colors are there?
16,777,216 — 256 values each for red, green and blue (256³).