UI State Color Generator
Enter one primary brand color and instantly generate a complete semantic state system — success, warning, error, info, hover, active, focus, disabled — with WCAG checks and light/dark previews.
Harmony Strategy
| State | Role | Color | Contrast vs White | Contrast vs Black |
|---|
What Is a UI State Color Generator?
A UI State Color Generator takes a single primary brand color and produces the complete set of semantic and interactive colors that every modern UI needs: success (green), warning (yellow/amber), error (red), info (blue), plus hover, active, focus, and disabled variations of every interactive element.
Designers and developers usually spend hours picking these colors manually — trying to keep the palette harmonious, ensuring WCAG contrast, and making sure hover states don't look jarring. This tool automates all of it. Give it one primary color, and it outputs a coherent design system state palette in under a second.
The output follows the same principles used by Material Design, Tailwind CSS, shadcn/ui, Radix Colors, and other modern design systems: hue harmony for coherence, lightness shifts for hierarchy, saturation tuning for accessibility.
The 12 States Every UI Needs
A complete UI state system covers three categories of color roles:
1. Semantic States (Fixed Meaning)
These colors mean the same thing across every app. Users have a mental model for them — a red button means "destructive," a green alert means "success." Don't break the model.
- Success — Confirmation, completion, positive outcome (usually green)
- Warning — Caution, attention needed, non-critical issue (usually amber/yellow)
- Error — Failure, destructive action, validation error (usually red)
- Info — Neutral notification, helpful tip, guidance (usually blue)
2. Interactive States (Primary Variants)
These are variations of the primary brand color for interaction feedback. Each one signals a different user intent or interaction phase:
- Primary — Default interactive color (buttons, links, focus states)
- Primary Hover — Slightly darker (light mode) or lighter (dark mode) than primary
- Primary Active — Darker still, used when the element is being clicked
- Primary Focus — Often a bright ring, slightly offset from the button
- Primary Disabled — Desaturated and reduced opacity; non-clickable
3. Neutral Surfaces
Backgrounds, borders, and text colors that form the "canvas" for your colorful states. These should be quiet — they exist to support the semantic colors.
- Surface — Cards, panels, popovers
- Surface Elevated — Modals, dropdowns (higher elevation)
- Border — Dividers, input borders, card outlines
- Text Primary — Main body text
- Text Secondary — Muted/hint text
How Harmony Strategies Affect Your States
Not every brand color pairs well with the "standard" success green and error red. This tool offers six harmony strategies so the generated states feel coherent with your primary:
🎨 Analogous
States stay near your primary's hue. Feels subtle and cohesive. Best for calm, professional UIs.
⚡ Complementary
States use the opposite hue for maximum distinction. Best when states need to stand out.
△ Triadic
States distributed 120° apart on the wheel. Vibrant, playful, memorable.
🔱 Split Complementary
Two colors flanking the complement. Balanced contrast without being aggressive.
◻️ Tetradic
Four colors evenly spaced. Rich but risky — often too busy for a state system.
⚪ Monochromatic
All states are lightness/saturation variants of the primary hue. Minimalist, elegant, safe.
For most UIs, Analogous or Split Complementary produces the most professional result. Complementary is best when you want maximum differentiation (e.g., a red "delete" button next to a blue "save" button).
Designing Hover, Active, Focus & Disabled
Interactive states are the most-used part of a design system and the easiest to get wrong. Here's how each one should feel:
Hover
The hover state is a preview — the user is considering clicking. It should look slightly different from the default: 8–12% darker in light mode, 8–12% lighter in dark mode. Not too subtle (looks broken) or too strong (looks jarring).
Active (Pressed)
The active state confirms the click. It should feel recessed — usually 15–20% darker than the default, sometimes with a slight scale-down transform. It's only visible for a moment, but it's the difference between a button that feels responsive and one that feels dead.
Focus
The focus state is an accessibility requirement — it shows keyboard users where their focus is. It should be extremely visible: usually a bright ring (2–3px) around the element, offset by 2–4px. The focus ring should have at least 3:1 contrast against the surrounding background.
Disabled
Disabled means "not available right now." It should look inert: desaturated (40–60% less saturated than primary), reduced opacity (usually 40–50%), and often a grey cursor. Critically, disabled elements must still be distinguishable from the background — 30% opacity on white is still clickable-looking.
| State | Lightness Change | Saturation Change | Notes |
|---|---|---|---|
| Hover | -8% (light) / +8% (dark) | None | Subtle preview of interaction |
| Active | -16% (light) / +16% (dark) | None | Confirms click, feels pressed |
| Focus | +5% brightness | +10% saturation | High-visibility accessibility ring |
| Disabled | None | -50% | 40% opacity, pointer-events: none |
Where UI State Colors Matter
🚀 SaaS Product
Ship a complete design system from a brand color. Every button, alert, badge, and input has its state colors ready.
🎨 Design System
Generate semantic tokens in Figma, Tailwind, or CSS. One primary, twelve states — documented, consistent, accessible.
📱 Mobile App
iOS and Android expect distinct states. Convert your brand primary into all the states both platforms need.
🛍️ E-commerce
Cart, checkout, and account states all need distinct colors. Generate them from your brand primary in seconds.
💼 Admin Dashboard
Charts, notifications, status indicators — all need semantic colors that harmonize with your brand.
📝 Form-heavy Apps
Validation, success, warning — every form field state needs its own color. Get them all automatically.
UI State Color Best Practices
- Don't use success green for "safe" or info blue for "default." Semantic colors have fixed meanings — using them loosely erodes user trust.
- Test hover on real devices. Hover states rarely trigger on touch devices — provide alternate feedback (focus ring, active state) for mobile.
- Focus ring must be visible. At least 3:1 contrast against the background, 2–3px wide, offset from the element. Never remove focus outline without replacing it.
- Disabled ≠ invisible. Disabled elements should still be readable (contrast ≥ 3:1) even if they're not clickable.
- Check contrast on every state. Text on a hover state must still pass WCAG AA. This tool computes it for you.
- Keep disabled and hover distinct. A disabled button that looks like a hover state is a UX bug. Disabled should be desaturated AND lighter/darker, not just one.
- Provide dark mode variants. Hover states that darken in light mode should lighten in dark mode. This tool generates both.
UI State Color Generator FAQ
What is a UI State Color Generator?
A tool that takes a single primary brand color and generates the complete set of semantic and interactive states that a UI needs: success, warning, error, info, hover, active, focus, disabled, plus surface and text colors.
Why not just use Material Design or Tailwind colors?
Those palettes are designed as standalone colors — they don't automatically harmonize with your brand primary. If your brand is a specific blue, the default Material green may clash with it. This tool generates states tuned to your specific primary, so everything feels cohesive.
What are the 12 states generated?
Primary, primary hover, primary active, primary focus, primary disabled, success, warning, error, info, surface, border, and text. Together they cover every color role a modern UI needs.
How does the harmony strategy affect the output?
Harmony determines the hue of each state. Analogous keeps states near your primary's hue. Complementary uses the opposite hue. Triadic uses colors 120° apart. Semantic states (success/error/warning) still respect their traditional hue zones (green, red, amber) — harmony only affects the exact shade.
Why do success/error/warning keep their traditional colors?
Because users have fixed mental models: green = success, red = error, amber = warning. Changing these hues causes confusion — a "success" message in purple doesn't communicate success to most users. Harmony strategies adjust the exact shade (e.g., a warmer vs. cooler green) without breaking the semantic meaning.
How do hover and active states work?
Hover is a subtle preview of interaction: ~10% darker in light mode, ~10% lighter in dark mode. Active (pressed) is stronger: ~18% darker/lighter, often with a slight scale-down transform. Both preserve hue and saturation.
What should the focus state look like?
Focus is an accessibility requirement — it should be highly visible. Usually a bright ring (2–3px) around the element, offset by 2–4px, with at least 3:1 contrast against the background. Never remove focus outline without providing an alternative.
Why is disabled desaturated instead of just lighter?
Because "lighter" alone looks like a hover state. Disabled needs a distinct visual treatment: desaturated (less colorful), reduced opacity, and often a grey appearance. This makes it clearly non-interactive even to users who aren't reading carefully.
Does this tool generate dark mode colors?
Yes. The preview shows both light and dark versions side by side. Dark mode variants swap the hover direction (lighter instead of darker) and adjust saturation so states don't look too vivid on dark backgrounds.
Can I override individual state colors?
Yes. Every swatch in the state table has a clickable color input. Change any color to fine-tune, and the previews and output update in real time.
What output formats are available?
Three: CSS variables (ready to paste into :root), Tailwind config (for tailwind.config.js), and JSON (for design tokens or Figma tokens).
Does this tool work for both light and dark mode?
Yes. The state table shows the "base" colors that work in light mode. Dark mode variants are shown in the dark preview panel. For production, run the output through the Light to Dark Theme Converter to generate the complete dark palette.
Are the generated colors WCAG-compliant?
The tool checks contrast of every state color against both white and black text, and shows the ratio in the table. Text placed on these colors should use the appropriate foreground (white on dark colors, black on light colors) to pass WCAG AA.
Can I use this for a React, Vue, or Angular app?
Yes. The CSS variables output works in any framework — just paste into your global stylesheet and reference with var(--success), var(--primary-hover), etc. The Tailwind output works for any Tailwind-based project.
Is this tool free?
Yes. Completely free, no signup, no email, no data collection. Everything runs locally in your browser.