How to use the visualizer
Set your brand color with the input or the sliders, then toggle light and dark to see the full interface repaint in real time. When it looks right, copy the CSS variables and drop them into your project — or share the URL, which encodes the exact color.
Why OKLCH-derived themes
A theme built by nudging lightness and chroma in OKLCH stays perceptually consistent: dark mode is a true lightness inversion, neutrals share your brand hue without looking muddy, and the guaranteed-contrast foreground tokens hold across the whole hue circle. It is the same engine philosophy as the theme builder, aimed at a live full-page preview rather than a single scale.
Frequently asked questions
How does one color become a whole theme?
Your color sets the brand: `primary` starts from your color's chroma (clamped only as needed for sRGB), while the neutrals (background, card, muted, border) carry a faint trace of the same hue at very low chroma, so the whole UI feels cohesive. Light and dark mode are an OKLCH-lightness inversion of that neutral ramp — not a separate palette. The destructive red stays fixed so danger actions remain recognizable.
Is the generated theme accessible?
Primary and destructive button text is chosen black or white at the WCAG luminance crossover, so it always clears AA (4.5:1) on those colors; the neutral foreground/surface pairs are derived in OKLCH and contrast-tested to AA. Note that if you pick a very light or very dark brand color, primary buttons can still be low-contrast against the page itself — the live preview shows you exactly when that happens.
Does this work with Tailwind or shadcn/ui?
Yes. The exported CSS uses the same token names shadcn/ui expects (`--background`, `--primary`, `--muted-foreground`, etc.), with a `:root` block for light and a `.dark` block for dark. Paste it into your global stylesheet and your components inherit the theme.
Why derive it in OKLCH instead of HSL?
OKLCH is perceptually uniform, so a fixed lightness reads as the same brightness across hues — which is what makes the dark-mode inversion and the readable-text guarantee actually hold. HSL lightness does not behave that way (yellow at 50% looks far brighter than blue at 50%).
Is my color sent anywhere?
No. The whole theme is derived in your browser. Your brand color is encoded in the URL so you can share or bookmark a theme, but nothing is uploaded.
Related tools
References
This tool’s color math is grounded in the following standards and primary sources.
- A perceptual color space for image processing (OKLab / OKLCH) — Björn Ottosson, 2020
- Web Content Accessibility Guidelines (WCAG) 2.2 — W3C Recommendation
- CSS Color Module Level 4 — W3C Candidate Recommendation
- culori — color library — Dan Burzo (MIT)
Spotted an error? Let us know — reader corrections are the best review this site gets.