| name | color-palette-generator |
| description | Generates accessible, harmonious color palettes with contrast-checked values,
semantic roles (primary, surface, error, etc.), and CSS/Tailwind token outputs.
Use this skill whenever a user says "generate a color palette", "create a color
scheme for my app", "pick colors for my design system", "make accessible colors",
"generate color tokens", "what colors should I use for this brand?", "check if
these colors pass WCAG", or "create a dark mode color palette". Also activate
when someone describes a brand or visual mood and wants a concrete color set.
Do NOT use for choosing fonts (typography skill) or icon/illustration color
matching (art direction skill).
|
Color Palette Generator
Design accessible, harmonious color palettes with WCAG-compliant contrast ratios,
semantic roles, and ready-to-use CSS custom property outputs.
When to Use
- Starting a new design system and needing a foundational palette
- Creating a brand color system with primary, secondary, and semantic variants
- Adding a dark mode palette to an existing light mode design
- Checking whether existing colors meet WCAG contrast requirements
When NOT to Use
- Choosing illustration or photography color direction
- Typography and font pairing (separate concern)
- Image color palette extraction from photos
Workflow
Step 1 โ Understand the Palette Requirements
Ask for:
- Brand / mood: Is there a brand color to start from, or a mood description?
- Use case: Marketing site / app UI / data visualization / dark mode
- Number of colors: Minimal (2โ3 base) or comprehensive (full scale)?
- Output format: CSS variables / Tailwind config / Figma tokens / plain hex list
Step 2 โ Design the Semantic Color Roles
A complete UI palette covers these semantic roles:
| Role | Purpose |
|---|
| Primary | Main brand color โ CTAs, links, active states |
| Secondary | Accent color โ supporting actions, highlights |
| Success | Positive outcomes โ confirmation, complete |
| Warning | Caution โ degraded state, pending |
| Error / Danger | Destructive / failed โ errors, delete actions |
| Neutral | Surfaces, borders, text โ the workhorse |
| Surface | Background layers (page, card, modal) |
Step 3 โ Generate the Color Scale
For each base hue, generate a 10-step scale (50โ900) following the OKLCH / HSL lightness curve:
Example: Blue primary
blue-50: #EFF6FF (near white tint โ hover backgrounds)
blue-100: #DBEAFE (light tint โ selected backgrounds)
blue-200: #BFDBFE
blue-300: #93C5FD
blue-400: #60A5FA (accessible on dark backgrounds)
blue-500: #3B82F6 (base / brand color)
blue-600: #2563EB (primary buttons โ passes 4.5:1 on white)
blue-700: #1D4ED8 (hover state for primary)
blue-800: #1E40AF
blue-900: #1E3A8A (dark text on light backgrounds)
Step 4 โ Check Contrast Ratios
For key text/background combinations:
| Combination | Ratio | WCAG |
|---|
blue-600 (#2563EB) on white | 5.9:1 | โ
AA |
blue-500 (#3B82F6) on white | 3.9:1 | โ AA (use for large text only) |
blue-700 (#1D4ED8) on white | 7.2:1 | โ
AAA |
White on blue-600 | 5.9:1 | โ
AA |
Step 5 โ Generate CSS Custom Properties
:root {
--color-primary-50: #EFF6FF;
--color-primary-100: #DBEAFE;
--color-primary-200: #BFDBFE;
--color-primary-300: #93C5FD;
--color-primary-400: #60A5FA;
--color-primary-500: #3B82F6;
--color-primary-600: #2563EB;
--color-primary-700: #1D4ED8;
--color-primary-800: #1E40AF;
--color-primary-900: #1E3A8A;
--color-brand: var(--color-primary-600);
--color-brand-hover: var(--color-primary-700);
--color-success: #16A34A;
--color-warning: #D97706;
--color-error: #DC2626;
--color-text-primary: #111827;
--color-text-muted: #6B7280;
--color-surface: #FFFFFF;
--color-surface-alt: #F9FAFB;
--color-border: #E5E7EB;
}
@media (prefers-color-scheme: dark) {
:root {
--color-brand: var(--color-primary-400);
--color-brand-hover: var(--color-primary-300);
--color-text-primary: #F9FAFB;
--color-text-muted: #9CA3AF;
--color-surface: #111827;
--color-surface-alt: #1F2937;
--color-border: #374151;
}
}
Step 6 โ Tailwind Config Extension
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: '#EFF6FF',
100: '#DBEAFE',
500: '#3B82F6',
600: '#2563EB',
700: '#1D4ED8',
},
brand: 'var(--color-brand)',
},
},
},
};
Contrast Verification Table (output for each palette)
Text Color | Background | Ratio | WCAG AA | WCAG AAA
primary-600 text | white | 5.9:1 | โ
| โ
white text | primary-600| 5.9:1 | โ
| โ
gray-700 text | white | 7.4:1 | โ
| โ
gray-500 text | white | 4.6:1 | โ
| โ
Output Format
- 10-step color scale โ hex values for each base hue
- Semantic tokens table โ role โ token โ hex โ contrast ratio
- CSS custom properties โ light + dark mode
:root block
- Tailwind config extension โ if applicable
- Contrast verification table โ key text/bg combinations
Safety & Confirmation
- Always flag colors that fail 4.5:1 AA contrast for normal text.
- Note that yellow and orange are notoriously difficult to make accessible โ always check.
- Suggest a darker shade of warning yellow for text (
#92400E on white = 7.4:1) vs. background use.
- For data visualization palettes, note that roughly 8% of men have color vision deficiency โ recommend testing with a color blindness simulator.