Skip to content

Design-system workspace

Design Token and State Generator

Turn one seed into a perceptual 50-950 scale, semantic light and dark roles, measured contrast evidence, and copy-ready CSS, JSON, and Tailwind tokens.

Enter Hex, RGB, HSL, OKLCH, or a CSS color name. The ramp updates locally.

Normalized

#4F46E5

Perceptual 50-950 scale

Ordered by OKLCH lightness, then rendered into sRGB.

Pairings are tested, not guaranteed

50

#F3F7FF

100

#E1E9FF

200

#C4CFFF

300

#A1AEFF

400

#818BFF

500

#6565FF

600

#4F49E0

700

#3B31B5

800

#261984

950

#0F0546

Semantic roles in context

Light and dark companions use the same scale with job-specific aliases.

Light mode

A semantic interface state

Tokens describe a job. Contrast results below determine whether each intended pairing passes.

Surface card

Background, surface, border, text, muted text, focus, hover, and active roles are exported.

Dark mode

A semantic interface state

Tokens describe a job. Contrast results below determine whether each intended pairing passes.

Surface card

Background, surface, border, text, muted text, focus, hover, and active roles are exported.

Measured contrast evidence

Ratios are recomputed from the final sRGB tokens. A failed row needs manual adjustment before production use.

ModePairPurposeRatioResult
lighttext / backgroundNormal text, WCAG 2.2 AA17.30:1Pass · 4.5:1
lightmutedText / backgroundSecondary normal text, WCAG 2.2 AA12.58:1Pass · 4.5:1
lightonPrimary / primaryText on primary, WCAG 2.2 AA6.25:1Pass · 4.5:1
lightprimary / backgroundUI component boundary / large text5.82:1Pass · 3:1
lightfocus / backgroundFocus indicator contrast4.03:1Pass · 3:1
darktext / backgroundNormal text, WCAG 2.2 AA17.30:1Pass · 4.5:1
darkmutedText / backgroundSecondary normal text, WCAG 2.2 AA12.13:1Pass · 4.5:1
darkonPrimary / primaryText on primary, WCAG 2.2 AA7.07:1Pass · 4.5:1
darkprimary / backgroundUI component boundary / large text6.25:1Pass · 3:1
darkfocus / backgroundFocus indicator contrast6.25:1Pass · 3:1

Export implementation tokens

CSS variables, JSON, or a Tailwind theme extension.

:root {
  --color-brand-50: #F3F7FF;
  --color-brand-100: #E1E9FF;
  --color-brand-200: #C4CFFF;
  --color-brand-300: #A1AEFF;
  --color-brand-400: #818BFF;
  --color-brand-500: #6565FF;
  --color-brand-600: #4F49E0;
  --color-brand-700: #3B31B5;
  --color-brand-800: #261984;
  --color-brand-950: #0F0546;
  --color-background: #F3F7FF;
  --color-surface: #FFFFFF;
  --color-border: #C4CFFF;
  --color-text: #0F0546;
  --color-muted-text: #261984;
  --color-primary: #4F49E0;
  --color-on-primary: #FFFFFF;
  --color-hover: #3B31B5;
  --color-active: #261984;
  --color-focus: #6565FF;
}

[data-theme="dark"], .dark {
  --color-background: #0F0546;
  --color-surface: #261984;
  --color-border: #3B31B5;
  --color-text: #F3F7FF;
  --color-muted-text: #C4CFFF;
  --color-primary: #818BFF;
  --color-on-primary: #000000;
  --color-hover: #A1AEFF;
  --color-active: #C4CFFF;
  --color-focus: #818BFF;
}

How to Use the Design Token Generator

Enter a seed in Hex, RGB, HSL, OKLCH, or a CSS color name. Review the perceptual scale, inspect semantic roles in light and dark interface previews, then check every measured pairing. Copy the implementation format that fits your codebase and adjust any row marked Needs work.

Why OKLCH Helps Color Scales

OKLCH separates perceived lightness, chroma, and hue more evenly than HSL. That makes it a useful basis for ordered UI states, although gamut conversion and real interface context still matter. This tool reports the final sRGB values and measures those exact values rather than relying on the source coordinates alone.

From Scale Steps to Semantic Roles

Numeric steps are raw palette values; semantic roles describe intent. Background, surface, border, text, primary, hover, active, and focus aliases make a design system easier to change without rewriting component styles. Light and dark companions share the same underlying ramp while using different roles.

Frequently Asked Questions about Design Token and State Generator

The generator holds the seed hue steady and orders each step by OKLCH lightness, with less chroma near the lightest and darkest ends. Final values are rendered to sRGB so the exported Hex tokens match browser output.