Loading...
Loading...
Generate complete, accessible color palettes from a single brand hex. Creates 11-shade scale (50-950), semantic tokens (background, foreground, card, muted), and dark mode variants. Includes WCAG contrast checking for text accessibility. Use when: setting up design system, creating Tailwind theme, building brand colors from single hex, converting designs to code, checking color accessibility.
npx skill4agent add jezweb/claude-skills color-palette// Input: Brand hex
const brandColor = "#0D9488" // Teal-600
// Output: 11-shade scale + semantic tokens + dark mode
primary-50: #F0FDFA (lightest)
primary-500: #14B8A6 (brand)
primary-950: #042F2E (darkest)
background: #FFFFFF
foreground: #0F172A
primary: #14B8A6| Shade | Lightness | Use Case |
|---|---|---|
| 50 | 97% | Subtle backgrounds |
| 100 | 94% | Hover states |
| 200 | 87% | Borders, dividers |
| 300 | 75% | Disabled states |
| 400 | 62% | Placeholder text |
| 500 | 48% | Brand color |
| 600 | 40% | Primary actions |
| 700 | 33% | Hover on primary |
| 800 | 27% | Active states |
| 900 | 20% | Text on light bg |
| 950 | 10% | Darkest accents |
// Example: #0D9488 → hsl(174, 84%, 29%)
// H (Hue): 174deg
// S (Saturation): 84%
// L (Lightness): 29%references/shade-generation.md--background: white
--foreground: primary-950
--card: white
--card-foreground: primary-900
--muted: primary-50
--muted-foreground: primary-600
--border: primary-200
--primary: primary-600
--primary-foreground: white--background: primary-950
--foreground: primary-50
--card: primary-900
--card-foreground: primary-50
--muted: primary-800
--muted-foreground: primary-400
--border: primary-800
--primary: primary-500
--primary-foreground: whitereferences/semantic-mapping.md| Light Mode | Dark Mode |
|---|---|
| 50 (97% L) | 950 (10% L) |
| 100 (94% L) | 900 (20% L) |
| 200 (87% L) | 800 (27% L) |
| 500 (brand) | 500 (brand, slightly brighter) |
:root {
--background: white;
--foreground: hsl(var(--primary-950));
}
.dark {
--background: hsl(var(--primary-950));
--foreground: hsl(var(--primary-50));
}primary-600whitewhiteprimary-600primary-900primary-50contrast = (lighter + 0.05) / (darker + 0.05)
// Where lighter/darker are relative luminance valuesreferences/contrast-checking.md@theme@theme {
--color-primary-50: #F0FDFA;
--color-primary-500: #14B8A6;
--color-primary-950: #042F2E;
--color-background: #FFFFFF;
--color-foreground: var(--color-primary-950);
}| File | Purpose |
|---|---|
| Hex→HSL conversion, lightness values |
| Token mapping for light/dark modes |
| Inversion patterns, shade swapping |
| WCAG formulas, quick check table |
| Complete CSS output template |
| Common mistakes and corrections |
@theme {
/* Shade scale */
--color-primary-50: #F0FDFA;
--color-primary-100: #CCFBF1;
--color-primary-200: #99F6E4;
--color-primary-300: #5EEAD4;
--color-primary-400: #2DD4BF;
--color-primary-500: #14B8A6;
--color-primary-600: #0D9488;
--color-primary-700: #0F766E;
--color-primary-800: #115E59;
--color-primary-900: #134E4A;
--color-primary-950: #042F2E;
/* Light mode semantics */
--color-background: #FFFFFF;
--color-foreground: var(--color-primary-950);
--color-primary: var(--color-primary-600);
--color-primary-foreground: #FFFFFF;
}
.dark {
/* Dark mode overrides */
--color-background: var(--color-primary-950);
--color-foreground: var(--color-primary-50);
--color-primary: var(--color-primary-500);
}@theme {
--color-primary-50: #FAF5FF;
--color-primary-500: #A855F7;
--color-primary-950: #3B0764;
--color-background: #FFFFFF;
--color-foreground: var(--color-primary-950);
--color-primary: var(--color-primary-600);
}references/shade-generation.md