Random Color Generator
Generate random colors in hex, rgb, hsl. Useful for design inspiration.
How color is represented in computing
A digital color is a numeric triplet (or quadruple, with alpha) under a specific color model. The most common ones in the browser are RGB (Red/Green/Blue, additive, used by monitors), HEX (RGB in hexadecimal โ #RRGGBB), RGBA (RGB plus an alpha channel for opacity, 0-255 or 0.0-1.0), and HSL (Hue 0-360ยฐ, Saturation 0-100%, Lightness 0-100%), which is intuitive for humans and is the canonical CSS model.
With 8 bits per channel, RGB gives 24-bit color โ about 16.7 million unique combinations. Print and design pipelines also use CMYK (Cyan/Magenta/Yellow/Key, subtractive, used by printers), Lab / CIELAB (perceptually uniform โ used to compute color differences with ฮE), and HSB/HSV (Hue/Saturation/Value, similar to HSL but with Value instead of Lightness). Modern CSS adds OKLCH and HWB from CSS Color Module 4 โ OKLCH is essentially a perceptually-uniform replacement for HSL and is the most accurate way to interpolate between two colors.
Wide gamut and P3
Standard monitors use the sRGB gamut. Modern displays (recent MacBooks, iPhones, professional monitors) cover the Display P3 gamut, which can show roughly 50% more colors than sRGB โ especially saturated reds and greens. CSS Color 4 lets you target P3 explicitly with color(display-p3 r g b).
Why pure RGB random looks ugly
Picking R, G, B uniformly at random from 0-255 produces a lot of muddy browns, grays and dark colors โ the visually "interesting" portion of the RGB cube is a small fraction of the total. A better approach is to randomize in HSL with bounded Saturation and Lightness, for example S โ [40, 80] and L โ [40, 60], which keeps colors vivid and readable. For an even smoother distribution, pick a hue at random and sample S/L from a normal distribution around the centre.
Accessibility: WCAG contrast and color blindness
When using random colors in a UI, always re-check contrast. The WCAG standard requires 4.5:1 contrast for normal body text (level AA) and 7:1 for AAA. Roughly 8% of men and 0.5% of women have some form of color blindness โ protanopia (red-weak), deuteranopia (green-weak) and tritanopia (blue-weak) are the most common. Never use color as the only way to convey information.
FAQ
Why is "random color" almost always disappointing? Because the RGB cube is mostly dull โ most of the visually interesting colors live in a thin shell. Generators that look good in practice randomize in HSL/OKLCH with clamped saturation and lightness.
Can the tool produce a full palette (analogous, complementary, triadic)? Yes โ derive palettes by shifting hue: complementary is H + 180ยฐ, triadic is H ยฑ 120ยฐ, analogous is H ยฑ 30ยฐ, and split-complementary is H + 150ยฐ and H + 210ยฐ.
Should I use HEX, RGB or HSL in my CSS? Any of them work. HEX is shortest, RGB plays well with opacity, HSL is the easiest to tweak by hand. For modern projects, consider OKLCH for interpolations and gradients โ the result looks far more natural.
Does Tailwind or Material Design relate to this? Yes. Tailwind uses a fixed scale of 50โ950 per hue (slate-100 ... slate-900) where each step is roughly a fixed perceptual delta. Material Design 3 uses dynamic color tokens derived from a single seed hue, which is essentially OKLCH-based generation under the hood.
Related Tools
Handwriting Generator
Convert typed text into an image with handwriting appearance. Useful for adding a personal touch to digital work.
Resume Generator
Fill a simple printable A4 CV from a form with personal data, education and experience.
Favicon Generator
Generate a favicon from text/emoji in all common sizes (16, 32, 48, 64, 192, 512). PNG download.