Color Scale Generator
Overview
Generate perceptually uniform 11-step color scales (50-950) from any base color. Includes auto-generated neutral and semantic colors harmonized with the brand.
When to Use
- Starting a new project needing a color system
- Adding brand colors to an existing palette
- Building light/dark theme tokens
- Converting a single hex to a full scale
Quick Reference
| Step |
Lightness |
Typical Use |
| 50 |
97% |
Subtle backgrounds |
| 100 |
93% |
Hover states on light |
| 200 |
87% |
Borders, dividers |
| 300 |
78% |
Disabled states |
| 400 |
65% |
Placeholder text |
| 500 |
55% |
Primary brand color |
| 600 |
45% |
Hover on dark |
| 700 |
37% |
Active states |
| 800 |
27% |
Headings |
| 900 |
20% |
Body text |
| 950 |
14% |
High contrast text |
The Process
- Get input: Ask for base color (hex preferred) and color name (e.g., "primary")
- Ask format: CSS custom properties, Tailwind config, or JSON tokens?
- Ask color system (default OKLCH):
- OKLCH - Perceptually uniform, modern standard (recommended)
- HSL - Hue, Saturation, Lightness (wide browser support)
- RGB - Red, Green, Blue (universal compatibility)
- LCH - Lightness, Chroma, Hue (perceptual, CSS Color 4)
- HEX - Hexadecimal notation (maximum compatibility)
- Generate scale: Create 11 steps with consistent chroma/saturation
- Add neutrals: Generate neutral scale using same hue, minimal saturation
- Add semantics: Generate success, warning, error, info harmonized with brand
- Output: Provide complete token set in requested format
Color Systems
| System |
Format Example |
Best For |
| OKLCH |
oklch(55% 0.15 250) |
Modern browsers, perceptual accuracy |
| HSL |
hsl(220 80% 55%) |
Wide support, intuitive adjustments |
| RGB |
rgb(59 130 246) |
Universal, legacy systems |
| LCH |
lch(55% 60 250) |
Perceptual, CSS Color Level 4 |
| HEX |
#3b82f6 |
Maximum compatibility |
Recommend OKLCH for new projects - it produces more visually consistent scales because lightness and chroma are perceptually uniform.
Output Formats
CSS Custom Properties:
:root {
--primary-50: oklch(97% 0.01 250);
--primary-500: oklch(55% 0.15 250);
--primary-950: oklch(14% 0.10 250);
}
Tailwind Config:
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: 'oklch(97% 0.01 250)',
500: 'oklch(55% 0.15 250)',
}
}
}
}
}
JSON Tokens:
{
"color": {
"primary": {
"50": { "value": "oklch(97% 0.01 250)" },
"500": { "value": "oklch(55% 0.15 250)" }
}
}
}
Algorithm Details
Lightness stops (L values):
- 50: 0.97, 100: 0.93, 200: 0.87, 300: 0.78, 400: 0.65
- 500: 0.55, 600: 0.45, 700: 0.37, 800: 0.27, 900: 0.20, 950: 0.14
Chroma/saturation adjustment at extremes:
- L > 0.9: reduce to 30% (prevents washed-out pastels)
- L < 0.2: reduce to 70% (prevents muddy darks)
- Otherwise: full chroma
Semantic color hues (harmonized 10-15% toward brand):
- Success: base 145 (green)
- Warning: base 70 (amber)
- Error: base 25 (red)
- Info: base 250 (blue)
1---2name: color-scale3description: Generates perceptually uniform OKLCH color palettes from brand colors. Use when creating color systems, theme palettes, or converting hex values to 11-step scales. Outputs CSS custom properties, Tailwind config, or JSON tokens.4---5
6# Color Scale Generator
7
8## Overview
9
10Generate perceptually uniform 11-step color scales (50-950) from any base color. Includes auto-generated neutral and semantic colors harmonized with the brand.
11
12## When to Use
13
14- Starting a new project needing a color system
15- Adding brand colors to an existing palette
16- Building light/dark theme tokens
17- Converting a single hex to a full scale
18
19## Quick Reference
20
21| Step | Lightness | Typical Use |
22|------|-----------|-------------|
23| 50 | 97% | Subtle backgrounds |
24| 100 | 93% | Hover states on light |
25| 200 | 87% | Borders, dividers |
26| 300 | 78% | Disabled states |
27| 400 | 65% | Placeholder text |
28| 500 | 55% | Primary brand color |
29| 600 | 45% | Hover on dark |
30| 700 | 37% | Active states |
31| 800 | 27% | Headings |
32| 900 | 20% | Body text |
33| 950 | 14% | High contrast text |
34
35## The Process
36
371. **Get input**: Ask for base color (hex preferred) and color name (e.g., "primary")
382. **Ask format**: CSS custom properties, Tailwind config, or JSON tokens?
393. **Ask color system** (default OKLCH):
40 - OKLCH - Perceptually uniform, modern standard (recommended)
41 - HSL - Hue, Saturation, Lightness (wide browser support)
42 - RGB - Red, Green, Blue (universal compatibility)
43 - LCH - Lightness, Chroma, Hue (perceptual, CSS Color 4)
44 - HEX - Hexadecimal notation (maximum compatibility)
454. **Generate scale**: Create 11 steps with consistent chroma/saturation
465. **Add neutrals**: Generate neutral scale using same hue, minimal saturation
476. **Add semantics**: Generate success, warning, error, info harmonized with brand
487. **Output**: Provide complete token set in requested format
49
50## Color Systems
51
52| System | Format Example | Best For |
53|--------|----------------|----------|
54| OKLCH | `oklch(55% 0.15 250)` | Modern browsers, perceptual accuracy |
55| HSL | `hsl(220 80% 55%)` | Wide support, intuitive adjustments |
56| RGB | `rgb(59 130 246)` | Universal, legacy systems |
57| LCH | `lch(55% 60 250)` | Perceptual, CSS Color Level 4 |
58| HEX | `#3b82f6` | Maximum compatibility |
59
60**Recommend OKLCH** for new projects - it produces more visually consistent scales because lightness and chroma are perceptually uniform.
61
62## Output Formats
63
64**CSS Custom Properties:**
65```css
66:root {
67 --primary-50: oklch(97% 0.01 250);
68 --primary-500: oklch(55% 0.15 250);
69 --primary-950: oklch(14% 0.10 250);
70}
71```
72
73**Tailwind Config:**
74```js
75module.exports = {
76 theme: {
77 extend: {
78 colors: {
79 primary: {
80 50: 'oklch(97% 0.01 250)',
81 500: 'oklch(55% 0.15 250)',
82 }
83 }
84 }
85 }
86}
87```
88
89**JSON Tokens:**
90```json
91{
92 "color": {
93 "primary": {
94 "50": { "value": "oklch(97% 0.01 250)" },
95 "500": { "value": "oklch(55% 0.15 250)" }
96 }
97 }
98}
99```
100
101## Algorithm Details
102
103**Lightness stops** (L values):
104- 50: 0.97, 100: 0.93, 200: 0.87, 300: 0.78, 400: 0.65
105- 500: 0.55, 600: 0.45, 700: 0.37, 800: 0.27, 900: 0.20, 950: 0.14
106
107**Chroma/saturation adjustment** at extremes:
108- L > 0.9: reduce to 30% (prevents washed-out pastels)
109- L < 0.2: reduce to 70% (prevents muddy darks)
110- Otherwise: full chroma
111
112**Semantic color hues** (harmonized 10-15% toward brand):
113- Success: base 145 (green)
114- Warning: base 70 (amber)
115- Error: base 25 (red)
116- Info: base 250 (blue)