UI Color Palette GeneratorSurfaces, Borders, Text & Accents
A UI palette is a set of jobs, not a set of pretty colours. Generate five swatches for a web or app interface, assign the lightest to surfaces and the darkest to text, and check the contrast of every pairing before it reaches a component library.
- Under 50 ms
- 100% client-side
- HEX, RGB & HSL
- Unlimited palettes
Live palette preview
Everything runs in this tab. No palette is uploaded, saved or limited.
Space to shuffle · 1–5 to lock
Need artwork for the palette? Resize an image, convert HEIC to JPG or check an aspect ratio — all local.
WCAG contrast checker
Test any text colour against any background. The ratio is calculated from relative luminance, exactly as WCAG defines it.
CSS custom properties
Five named variables, ready for a :root block. Copy the set and the palette moves into your stylesheet.
ToolGuest UI Color Palette Generator produces a five-swatch interface palette: surface, raised surface, border, body text and accent. It uses a split-complementary rule by default so one hue dominates and two accents stay available, prints HEX, RGB and HSL codes, exports CSS variables and checks WCAG AA and AAA contrast locally.
A web design color palette generator that thinks in roles
Interfaces fail on colour for a predictable reason: the palette has five accents and no neutrals. A component library needs a background, a card, a divider, a text colour and one accent that means act here. Everything else is a tint of those five, derived with opacity or a lightness step.
Split-complementary is the default on this page because it is the most forgiving rule for a UI. One hue dominates the surfaces, and the two hues opposite it — 150 and 210 degrees away — supply a primary and a secondary accent that are distinct without vibrating against each other the way a pure complement can.
| UI role | Where it appears | Contrast target |
|---|---|---|
| Surface | Page background, empty states | Base for every other pair; no contrast requirement of its own. |
| Raised surface | Cards, modals, dropdowns | Distinct from the surface by lightness, not only by a border. |
| Border | Inputs, dividers, table rules | 3:1 against the surface if the border is the only affordance. |
| Body text | Paragraphs, labels, table cells | 4.5:1 against the surface at AA, 7:1 at AAA. |
| Accent | Primary buttons, links, focus rings | 4.5:1 for text on the accent, 3:1 for the accent against the surface. |
Building an app color scheme generator output into a theme
Copy the palette as CSS variables and the five roles become --color-primary through --color-deep. Rename them to the roles your component library already uses — surface, surface-raised, border, text, accent — and every component inherits the new theme without touching a single component file.
Dark mode is the test of whether a palette was designed as roles or as five colours. A dark theme is not an inversion; it needs a different surface pair and usually a slightly desaturated accent, because saturated colours bloom on dark backgrounds. Generate a second palette from the same base with a lower lightness and keep the accent hue identical so the brand still reads.
The same five values feed a Tailwind theme, a design token JSON file or a Figma styles library. Because the palette is generated from one base colour, a rebrand is one input change and one re-export rather than a manual sweep through every component.
Which UI pairs must pass contrast
Three pairings decide whether an interface is usable: body text on the surface, text on the accent, and the accent against the surface. The first two need 4.5:1 at AA for normal text; the third needs 3:1 when the accent is a large graphic or a border that carries meaning.
Focus rings are the pairing most often forgotten. A focus indicator must be visible against both the surface and the component it surrounds, which in practice means 3:1 against each. Test the accent against the surface and against the raised surface before shipping a keyboard-accessible component.
The accessible colour palette page goes deeper on thresholds, and the colour scheme generator covers the wider brand palette this UI theme sits inside.
UI palette questions
What is a UI color palette?
It is the small set of colours an interface is built from, organised by role rather than by hue: a surface, a raised surface, a border, body text and one accent. Everything else in the design system is a tint or opacity of those five values.
Why is split-complementary the default on this page?
It gives one dominant hue for surfaces plus two distinct accent hues that sit opposite it, so a primary and a secondary action can be told apart without the visual vibration a pure complementary pair can produce. Every other harmony rule is still one click away.
How many colours does a web app design system need?
Five core colours cover most interfaces, plus semantic states for success, warning and error. Those states are usually fixed hues rather than generated ones, because users expect green, amber and red to mean the same thing on every product. Everything else is a tint or an opacity of the core five.
What contrast ratio does button text need?
Text on a button needs 4.5:1 against the button background at WCAG AA for normal sizes, and 3:1 for large text of 18pt or 14pt bold. The button colour itself needs 3:1 against the surrounding surface so the control is distinguishable.
Can I use the generated palette for a dark mode theme?
Yes, but generate it separately rather than inverting the light palette. Use the same base hue with lower lightness for surfaces and a slightly desaturated accent, because fully saturated colours bloom on dark backgrounds. Check the text-on-surface ratio again for the dark pair.
Every palette and contrast tool in the ToolGuest cluster
Seven palette pages share one engine, so a colour scheme, a HEX palette, an analogous or complementary set and a WCAG-checked accessible palette all generate the same way. The three media tools finish the job once the colours are chosen.