Skip to content
color-palette logo

Color Palette Generation

color-palette

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 them...

SKILL.md

Full skill instructions

Color Palette Generation

Status: Production Ready ✅ Last Updated: 2026-01-14 Standard: Tailwind v4 @theme syntax


Quick Start

Generate complete palette from brand hex:

// 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

Use the reference files to generate shades, map semantics, and check contrast.


Color Scale Overview

Standard 11-Shade Scale

ShadeLightnessUse Case
5097%Subtle backgrounds
10094%Hover states
20087%Borders, dividers
30075%Disabled states
40062%Placeholder text
50048%Brand color
60040%Primary actions
70033%Hover on primary
80027%Active states
90020%Text on light bg
95010%Darkest accents

Key principle: Shade 500 represents your brand color. Other shades maintain hue/​saturation while varying lightness.


Hex to HSL Conversion

Convert brand hex to HSL for shade generation:

// Example: #0D9488 → hsl(174, 84%, 29%)
// H (Hue): 174deg
// S (Saturation): 84%
// L (Lightness): 29%

Generate shades by keeping hue constant, adjusting lightness:

  • Lighter shades (50-400): Reduce saturation slightly
  • Mid shades (500-600): Full saturation
  • Darker shades (700-950): Full saturation

See references/​shade-generation.md for conversion formula.


Semantic Token Mapping

Map shade scale to semantic tokens for components:

Light Mode

--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

Dark Mode

--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: white

Pattern: Invert lightness while preserving relationships. See references/​semantic-mapping.md.


Dark Mode Pattern

Swap light and dark shades:

Light ModeDark 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)

Preserve brand identity: Keep hue/​saturation consistent, only invert lightness.

CSS pattern:

:root {
  --background: white;
  --foreground: hsl(var(--primary-950));
}

.dark {
  --background: hsl(var(--primary-950));
  --foreground: hsl(var(--primary-50));
}

Contrast Checking

WCAG minimum ratios:

  • Text (AA): 4.5:1 normal, 3:1 large (18px+)
  • UI Elements: 3:1 (buttons, borders)

Quick check pairs:

  • primary-600 text on white background
  • white text on primary-600 background
  • primary-900 text on primary-50 background

Formula:

contrast = (lighter + 0.05) / (darker + 0.05)
// Where lighter/​darker are relative luminance values

See references/​contrast-checking.md for full formula and fix patterns.


Quick Reference

Generate Complete Palette

  1. Convert brand hex to HSL
  2. Generate 11 shades (50-950) by varying lightness
  3. Map shades to semantic tokens
  4. Create dark mode variants (invert lightness)
  5. Check contrast for text pairs

Tailwind v4 Output

Use @theme directive:

@theme {
  --color-primary-50: #F0FDFA;
  --color-primary-500: #14B8A6;
  --color-primary-950: #042F2E;

  --color-background: #FFFFFF;
  --color-foreground: var(--color-primary-950);
}

Common Adjustments

  • Too vibrant at light shades: Reduce saturation by 10-20%
  • Poor contrast on primary: Use shade 700+ for text
  • Dark mode too dark: Use shade 900 instead of 950 for backgrounds
  • Brand color too light/​dark: Adjust to shade 500-600 range

Resources

FilePurpose
references/​shade-generation.mdHex→HSL conversion, lightness values
references/​semantic-mapping.mdToken mapping for light/​dark modes
references/​dark-mode-palette.mdInversion patterns, shade swapping
references/​contrast-checking.mdWCAG formulas, quick check table
templates/​tailwind-colors.cssComplete CSS output template
rules/​color-palette.mdCommon mistakes and corrections

Token Efficiency

Without skill: ~8-12k tokens trial-and-error for palette generation With skill: ~3-4k tokens using references Savings: ~65%

Errors prevented:

  • Poor contrast ratios (accessibility violations)
  • Inconsistent shade scales
  • Broken dark mode (wrong lightness values)
  • Raw Tailwind colors instead of semantic tokens
  • Missing foreground pairs for backgrounds

Examples

Brand Color: Teal (#0D9488)

@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);
}

Brand Color: Purple (#7C3AED)

@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);
}

Next Steps: Use references/​shade-generation.md to convert your brand hex to HSL and generate the 11-shade scale.

More Design skills

brandkit logo
Design

brandkit

Premium brand-kit image generation for high-end identity systems, logo concepts, and visual-world presentations.

92.7K 345.8K
View

Premium website design-to-code skill that generates visual references first, then builds faithful frontend implementations.

92.7K 341.7K
View

Premium frontend image direction for landing pages and marketing sites, generating one distinct horizontal image per section.

92.7K 337.8K
View

Premium mobile app screen concepts and flows with clean hierarchy, strong imagery, and distinctive art direction.

92.7K 331.8K
View

Emil Kowalski's philosophy on UI polish, component design, and the invisible details that make software feel good.

43.5K 323.4K
View

Frontend design and iteration for production-grade interfaces, from concept to ship.

76.8K 313.3K
View

Reverse-engineer design tokens from public websites into starter token files for your project.

232 129.9K
View
Animate logo
Design

Animate

Builds an animation from scratch by making the decisions in the order that determines whether it feels right.

43.5K 117.9K
View

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

179.7K 114.2K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

Design AI tools

Maze Guru logo
Images

Maze Guru

Chat-to-edit AI studio for product photos, portraits, branding, and video.

Freemium
View
R
Design

RoomGPT

Generate your dream room in seconds.

Paid
View

Redesign your interior in seconds using AI

Paid
View
Reroom logo
Design

Reroom

Transform rooms with AI-generated designs.

Freemium
View
Jife logo
Design

Jife

Transform Your Space with AI-Powered Japanese Interior Designs by Jife

Paid
View
Visily logo
Design

Visily

AI-powered wireframes for non-designers.

Free
View

Revolutionize Property Viewing with AI-Generated Floor Plans and Virtual Tours

Paid
View
Archsynth logo
Design

Archsynth

Transform sketches into stunning architectural renders with AI.

Paid
View