Master color design with color theory, accessibility, theming, and dark mode. Create harmonious color systems that work across contexts, support accessibility standards, and enable flexible theming...
Produce a contrast-verified color token file for this codebase — ramps, semantic layer, dark mode — with the math shown, not a color-theory lecture. Governing principle: color is a system, not a list: every hue ships as a full lightness ramp, components consume only semantic tokens, and no text/background pair ships without a computed contrast ratio.
skills/frontend-design/design-foundation first, or create the color slice as its start.skills/frontend-design/visual-hierarchy-refactoring.skills/frontend-design/accessibility-excellence.#[0-9a-fA-F]{3,8}\b, rgba?\(, hsla?\(, oklch\( across source + config. Deduplicate, count frequencies. Cluster near-identical values (ΔL < ~5) — each cluster is one intended color that drifted.theme.colors / @theme variables / CSS custom properties. Determine whether ramps exist or just single hexes.dark: classes, prefers-color-scheme, a .dark block.Ask in one batch, only what's missing: brand color to keep, or pick fresh (and the personality if picking: trustworthy/energetic/premium/friendly), and dark mode: now, later, or never. Infer the rest. Don't stall: with a clear de facto brand color, keep it, state the assumption, proceed.
#808080 and pure #000 are banned; they read as foreign next to any brand color.bg-primary/secondary/tertiary, text-primary/secondary/tertiary/disabled/inverse, border-primary/focus, interactive-primary/hover/active/disabled — mapped from the ramps. Components never touch ramp values directly.#000), text to gray-50/300, brand shifted one step lighter (light mode's 600 → dark's 500) and slightly desaturated if it vibrates. Re-verify every pair — light-mode ratios don't transfer.:root {
--brand-600: #2563EB; --brand-700: #1D4ED8; /* full 50–950 ramp in the real file */
--gray-600: #475569; --gray-900: #0F172A; /* brand-tinted neutrals, full ramp */
--red-600: #DC2626; --red-100: #FEE2E2; /* status mini-ramps: green/amber/red/cyan */
--color-bg-primary: #FFFFFF;
--color-text-primary: var(--gray-900); /* on bg-primary: 17.8:1 ✓ */
--color-text-secondary: var(--gray-600); /* on bg-primary: 7.6:1 ✓ */
--color-interactive-primary: var(--brand-600); /* white on it: 5.2:1 ✓ */
}
.dark {
--color-bg-primary: var(--gray-950);
--color-text-primary: var(--gray-50);
--color-interactive-primary: var(--brand-500);
}
Harmony theory, color psychology, ramp-construction technique, and color-blind palettes: references/color-theory.md.
Write tokens into the detected entry point (extend, don't fork). Migrate the top drift clusters from Step 1 in 1–3 high-traffic files; map the rest.
Deliver code plus this summary:
## Color tokens
[file path + full code]
## Palette decisions
- Brand: [hex] — [kept from code / chosen for [personality]]
- Neutrals: tinted toward [hue]
- Harmony: [mono/analogous/complementary/triadic] because [job it does]
- Dark mode: [shipped/deferred] — strategy: [.dark class / media query]
## Contrast verification
| Pair | Ratio | Standard | Pass |
| text-primary on bg-primary (light) | 17.8:1 | 4.5:1 | ✓ |
| white on interactive-primary | 5.2:1 | 4.5:1 | ✓ |
| text-secondary on bg-primary (dark) | ... | ... | ... |
[every shipped text and UI pairing, both modes]
## Migration map
| Found (cluster) | Count | Replace with |
| #3B82F6 / #3b82f7 / #3a80f0 | 23 | var(--color-interactive-primary) |
| ... |
## Migrated now
[files edited]
#808080, no pure #000 backgroundsskills/frontend-design/design-foundation; text sizes (for the large-text contrast threshold) from skills/frontend-design/typography-system.skills/frontend-design/visual-hierarchy-refactoring (lightness-based contrast hierarchy), skills/frontend-design/component-architecture (component color bindings), and audited by skills/frontend-design/accessibility-excellence.references/color-theory.md — harmony techniques with examples, color psychology by hue, how to construct a ramp by hand, color-blind-safe palettes, and dark-mode pitfalls in depth. Read when picking a palette from scratch or debugging a ramp that looks wrong.