Color Palette Generator
AI-poweredType a vibe such as 'desert at dusk' or 'cyberpunk lab' and get a 5-color palette with hex, RGB, HSL and OKLCH for every swatch.
Starter palette
Contrast between swatches (WCAG 2)
Each cell is one swatch as text on another as background. AA needs 4.5:1 for body text and 3:1 for large text and UI parts; AAA needs 7:1.
| Text ↓ on → | Background 1 (highlight) | Background 2 (accent) | Background 3 (primary) | Background 4 (background) | Background 5 (secondary) |
|---|---|---|---|---|---|
| 1 highlight | same colour | 1.2 Fail | 4.0 AA large | 6.2 AA | 2.4 Fail |
| 2 accent | 1.2 Fail | same colour | 3.1 AA large | 4.8 AA | 1.8 Fail |
| 3 primary | 4.0 AA large | 3.1 AA large | same colour | 1.5 Fail | 1.6 Fail |
| 4 background | 6.2 AA | 4.8 AA | 1.5 Fail | same colour | 2.5 Fail |
| 5 secondary | 2.4 Fail | 1.8 Fail | 1.6 Fail | 2.5 Fail | same colour |
01 · Definition
What is a color palette?
A color palette is a small, fixed set of colors used together across a design, typically a background, a surface, a text color and one or two accents. This generator turns a text description into five colors and gives each one as hex, RGB, HSL and OKLCH, so the values can go straight into CSS.
02 · Overview
How the Color Palette Generator works
Generate a five-color palette from a natural-language vibe. Each swatch copies with one click as hex, RGB, HSL or OKLCH. Change any swatch with the color picker or by typing a hex value, check the WCAG contrast ratio between every pair in the table, and export the set as CSS variables or a Tailwind theme. An AI model (Claude) proposes the colors; conversions and contrast are computed in your browser.
03 · Guide
WCAG contrast levels: AA, AAA and AA large
The contrast table under the swatches gives the WCAG 2 contrast ratio for every pair of colors, from 1:1 for identical colors to 21:1 for black on white, with one of four labels. The thresholds come from WCAG success criteria 1.4.3, 1.4.6 and 1.4.11.
Large text means at least 18 point, or 14 point bold, which WCAG puts at roughly 24px and 18.5px. Ratios are compared without rounding, so 4.49:1 does not pass 4.5:1.
| Label | Contrast ratio | Enough for |
|---|---|---|
| AAA | 7:1 or higher | Body text at the enhanced level (1.4.6) |
| AA | 4.5:1 up to 7:1 | Body text at the minimum level (1.4.3); large text at AAA |
| AA large | 3:1 up to 4.5:1 | Large text at AA; UI components and graphics (1.4.11) |
| Fail | Below 3:1 | Decoration only |
04 · Guide
Exporting a palette to CSS and Tailwind
Export writes the five colors in four forms. The CSS variables and the Tailwind v4 block use whichever format is selected (hex, RGB, HSL or OKLCH); the Tailwind v3 config and the plain list are always hex.
| Export | What it contains |
|---|---|
| CSS variables | A :root block with --color-1 to --color-5 |
| Tailwind v4 @theme | An @theme block with --color-palette-1 to --color-palette-5 |
| Tailwind v3 config | theme.extend.colors.palette with keys 1 to 5, in hex |
| Hex list | The five hex values separated by commas |
05 · Use cases
When to use the Color Palette Generator
- 01
Kick off a brand exploration without opening a design tool
- 02
Get a palette for a landing page before a designer is involved
- 03
Translate a mood board prompt into usable CSS variables
- 04
Generate quick swatches for a data viz or chart series
06 · Examples
Color Palette Generator examples
sunset over Tokyo
ex 01#ff9472, #f2709c, #5b3a8c, #1d2671, #c33764
A warm-to-cool gradient palette inspired by city dusk.
minimal forest morning
ex 02#e8efe6, #b7c9b1, #8aa78a, #4f6b56, #243d33
Soft greens stepping from highlight to deep shadow.
cyberpunk diner
ex 03#0d0221, #ff003c, #00f0ff, #ffd700, #f6019d
High-contrast neons over near-black backgrounds.
brutalist zine, high contrast
ex 04#f4f1de, #e07a5f, #3d405b, #81b29a, #f2cc8f
Warm paper base with a terracotta accent and a deep navy for text.
07 · FAQ
Palette: frequently asked questions
How does it pick the colors?
Can I edit a single swatch?
Why OKLCH and not just HSL?
Are the palettes accessible?
How do I turn a palette into CSS variables?
How many colors should a palette have?
What happens to the description I type?
08 · Guides
Palette guides
- HEX vs RGB vs HSL vs OKLCH: CSS Color Formats Compared→
HEX and RGB give red, green and blue. HSL gives hue, saturation and lightness. OKLCH gives perceptual lightness, chroma and hue. With conversion tables.
09 · Reference
Specs and further reading
These are the primary sources this tool follows. Where a specification defines the behaviour, we link the specification, not a summary of it.
- CSS Color Module Level 4
W3C. Defines the modern color spaces and notations used in the generated CSS.
- Understanding SC 1.4.3: Contrast (Minimum)
W3C WAI. The 4.5:1 and 3:1 thresholds that the contrast table labels each swatch pair against.
- Understanding SC 1.4.6: Contrast (Enhanced)
W3C WAI. The 7:1 threshold for body text and 4.5:1 for large text at level AAA.
- Understanding SC 1.4.11: Non-text Contrast
W3C WAI. The 3:1 threshold for user interface components and graphics.
- oklch()
MDN Web Docs. Reference for the perceptually uniform color space used for lightness ramps.
10 · More
Tools that pair with Palette
Color Picker & Converter
Convert a color between HEX, RGB, HSL, OKLCH and CMYK. Paste any of those formats or a CSS color name, and see WCAG contrast against white and black.
CSS Gradient Generator
Build linear, radial and conic CSS gradients with 2 to 8 color stops. Drag the stops or type exact values, then copy the CSS or a Tailwind class.
Glassmorphism Generator
Build a frosted-glass card with sliders for blur, opacity, saturation, border and radius. Preview it over five backdrops and copy the CSS or Tailwind.