UI Color Palette Generator
Extract a consistent, structured color palette from any image for your UI design system. Get hex codes and CSS variables that are ready to define as design tokens — and verify contrast before you build. Free, instant, no account required.
Building a UI Color System From a Visual Reference
Every design system needs a defined color vocabulary — a finite set of named values that every component draws from. The challenge is that color systems are often defined abstractly: pick a hue, generate tints and shades, pick an accent, add semantic colors. The result is technically correct but can feel disconnected from the actual product's visual identity. Starting from a real visual reference — a product screenshot, a brand image, or a piece of inspiration — grounds the color system in something that already has the right feeling, making the resulting palette feel more intentional than one assembled from scratch.
Structuring a UI Palette From Extracted Colors
Extract eight to ten colors from your reference image. From that set, map each extracted color to a role in your design system: primary interactive color (buttons, links, focused inputs), secondary brand color (headers, illustrations, badges), surface colors (page background, card background, sidebar), and neutrals (body text, borders, placeholders, dividers). If the extracted palette doesn't naturally include a useful neutral, the darkest or least-saturated extracted color often works — or derive a neutral by desaturating your primary slightly.
The CSS variables export makes this mapping explicit. Rename the generated variables from --color-1 to semantic names:--interactive-primary, --surface-base,--text-secondary. Now every component references purpose-driven tokens rather than raw hex values, making future updates a single change per token rather than a search-and-replace across every file.
Accessibility Starts at the Palette Stage
The best time to check contrast is before you design any components — while you're still deciding which colors serve which roles. Take your extracted hex codes and run the pairs you plan to use for text-on-background through a WCAG contrast checker. A typical issue: the primary brand color fails the 4.5:1 ratio against white at its original value but passes when darkened by 10 to 15 percent. Making this adjustment at the token level means every button, link, and label across the entire product inherits the accessible value automatically. Small businesses and startups often skip this step and pay for it in retrofits later — checking contrast when establishing the palette costs minutes and saves hours.
Dark Mode Considerations
If your product supports dark mode, it's worth extracting your palette from both a light-mode and dark-mode reference image if you have one. Alternatively, many dark mode palettes work well when derived from the same source — take the lightest one or two extracted colors and use them as dark-mode text values; use slightly lighter versions of the darkest extracted colors as dark-mode surface values. The CSS variables approach makes implementing dark mode straightforward: define a second :root block scoped to a dark-mode class or media query with the same variable names but dark-appropriate values.
Related Color Tools
Website Color Palette Generator
Generate hex codes, CSS variables, and Tailwind config for your website from any image.
Color Palette From Image
Extract up to 15 dominant colors from any image as hex codes, CSS variables, or Tailwind config.
Extract Colors From Image
Pick exact hex codes from any image reference. Built for designers and developers.
Frequently Asked Questions
How many colors should a UI design system have?
Most UI color systems work with eight to twelve named color tokens in production — covering primary, secondary, accent, surface variants, text variants, and border/divider colors. At the palette definition stage, extracting six to eight colors from a reference gives you a strong foundation. You'll typically derive additional tints and shades from these base values rather than extracting every specific tone you need.
Can I use the output in Figma Variables?
Yes. Copy the hex codes from the results and define them as Figma Variables in the Variables panel (Variable Type: Color). Name each variable with the semantic role it plays — such as color/interactive/primary or color/surface/base — and publish them to your library. Components that reference these variables update globally whenever you change a variable value.
What contrast ratio do I need to pass WCAG?
WCAG 2.1 Level AA requires a 4.5:1 contrast ratio for normal text (under 18pt / 14pt bold) and 3:1 for large text, decorative elements, and UI components like input borders. Level AAA requires 7:1 for normal text. Most products target AA compliance. Your primary interactive color against a white background should meet 4.5:1 — this is the most commonly failing pair in UI color systems that start from visual reference rather than contrast-first design.
How do I handle semantic colors like error, warning, and success?
Semantic colors are typically not derived from the brand palette — they follow conventions that users recognize across products (red for errors, amber for warnings, green for success). Define these separately, outside the extracted palette. Use the extracted brand colors for all brand-specific UI elements, and stick to conventional semantic colors for system feedback states to avoid confusing users with unfamiliar error or success colors.
Can I extract colors from an existing app screenshot?
Yes. Screenshots of existing products are a very common input. Upload a screenshot of your current app, a competitor's UI, or a design reference you're working from. UI screenshots typically have very distinct color blocks that produce clean, accurate palette extractions. This is particularly useful for auditing what colors are actually in use in a product versus what was specified in the design system.
Generate Your UI Color Palette Now
Upload any reference image and get design system-ready hex codes and CSS variables — free, instant, no account.
Generate UI Colors