원클릭으로
color-theory
Color theory for digital product and UI design — color models, harmony, contrast, scales, and visualization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Color theory for digital product and UI design — color models, harmony, contrast, scales, and visualization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Expert reference for application security — OWASP Top 10 mitigations, auth/authz, secrets management, cryptography, input validation, dependency hygiene, and secure-by-default code patterns
Expert reference for token counting, prompt compression, cost estimation, and quality preservation when optimizing prompts for Claude models
Experimentation design and A/B testing standards for product teams
Expert reference for digital accessibility — WCAG conformance, ARIA, and inclusive design patterns
Authoritative reference for agent architecture selection, multi-agent orchestration, tool design, memory systems, and failure mode prevention
Expert reference for evaluating LLM systems, RAG pipelines, and AI features in production
| name | color-theory |
| description | Color theory for digital product and UI design — color models, harmony, contrast, scales, and visualization. |
| version | 1 |
filter: invert(1). Dark surfaces must desaturate by 15–30% and shift lightness independently per hue. Blues shift less; yellows and oranges shift more. Saturated colors on dark backgrounds cause chromatic vibration — reduce chroma by at least 20%.hsl() CSS notation. HEX for static values; hsl() when the token must be overridable at runtime via CSS custom properties.slate (hue ~215°, saturation ~15%) is the correct model.#FF0000 (HSL 0°, 100%, 50%) in UI. It is maximally saturated and fails 4.5:1 against white. Use hsl(4, 86%, 46%) — Tailwind red-600 equivalent — for error states on white backgrounds.hsl(152, 57%, 37%) — similar to Tailwind green-700 — is the correct success color on white.The HSL Cylinder Model Visualize color as a cylinder: hue is the rotation around the circumference (0°=red, 120°=green, 240°=blue, 360°=red), saturation is the distance from the center axis (0%=gray, 100%=pure), lightness is the vertical position (0%=black, 50%=pure hue, 100%=white). Any color decision is a coordinate in this cylinder. Moving "along the axis" desaturates without shifting hue — the correct operation for dark mode adaptation. Moving "around the circumference" changes hue without changing vibrancy — the correct operation for harmony generation.
The Semantic Layer Contract
Raw color values (primitives) must never appear in component code. The contract has three tiers: (1) Primitive tokens: --color-blue-500: hsl(217, 91%, 60%) — these are never referenced by components directly. (2) Semantic tokens: --color-action-primary: var(--color-blue-500) — these map intent to primitive. (3) Component tokens: --button-background: var(--color-action-primary) — optional for complex systems. Switching themes means only the semantic layer changes; primitives and components stay untouched.
The Perceptual Uniformity Principle Mathematically equal steps in HSL lightness (e.g., every 10%) do not produce perceptually equal steps. Human vision is more sensitive to changes in mid-range lightness than at extremes. When building a scale from 50–900, use the CIELAB or OKLCH color space for step generation, then convert to HSL for output. Tools that generate Tailwind-style scales (Radix Colors, Palette by Tints) apply this correction automatically. A scale where each adjacent pair "feels the same distance apart" is perceptually uniform; one generated by incrementing HSL lightness by 10% is not.
The Chromatic Vibration Warning Placing two highly saturated complementary colors (180° apart) at equal lightness (~50%) side-by-side causes optical vibration — the eye cannot resolve the edge between them. The fix is always to desaturate one of them or change one lightness by at least 20 points. This is why red text on green background (or vice versa) is unusable regardless of contrast ratio — WCAG contrast ratio does not capture this effect.
| Term | Precise Meaning |
|---|---|
| Hue | The chromatic identity of a color, expressed as a degree on the color wheel (0–360°). Independent of lightness or saturation. |
| Chroma | The colorfulness relative to the brightness of a similarly illuminated white. Higher in OKLCH/CIELAB than in HSL's "saturation." |
| Saturation (HSL) | Distance from the neutral gray axis in HSL space (0–100%). At L=50, S=100% is the purest hue. At L=0 or L=100, saturation is irrelevant. |
| Lightness (HSL) | Luminance on a 0–100% scale where 50% is the pure hue, 0% is black, 100% is white. Not perceptually linear. |
| Contrast Ratio | The ratio of relative luminance between two colors, per WCAG. Range: 1:1 (identical) to 21:1 (black on white). |
| Relative Luminance | A linearized measure of perceived brightness per WCAG 2.x formula. Not the same as HSL lightness. #777777 has ~20% relative luminance despite 47% HSL lightness. |
| Color Harmony | A principled relationship between hues based on their angular distance on the color wheel. |
| Semantic Color | A color token whose name encodes purpose (--color-error) rather than appearance (--color-red). |
| Primitive Token | The lowest-level named color in a token system — a raw value like --color-red-500: hsl(4, 86%, 58%). Not referenced in UI directly. |
| Diverging Palette | A visualization palette with two sequential ramps meeting at a neutral midpoint, used when both directions from zero carry meaning. |
| Sequential Palette | A visualization palette that varies lightness (or chroma) monotonically from low to high for a single variable. |
| Categorical Palette | A visualization palette of perceptually distinct, unordered hues for nominal data. Max 7 entries. |
Mistake 1: Using brand primary color for body text
color: #6366F1 (Indigo 500, HSL 239°, 84%, 67%) on white background — contrast ratio 3.1:1, fails WCAG AA for normal text.--color-text-brand token set to hsl(239, 84%, 45%) (darker variant, ~5.2:1 on white). Use brand color only for decorative elements and large headings.Mistake 2: Inverting light mode colors 1:1 for dark mode
background: hsl(0, 0%, 100%) inverted to background: hsl(0, 0%, 0%) and text: hsl(220, 9%, 16%) inverted to text: hsl(220, 9%, 84%).hsl(222, 14%, 12%), dark mode text = hsl(210, 20%, 88%). Reduce saturation of accents by 20%. Shift lightness of accents up by 10–15 points to maintain contrast.Mistake 3: Building a gray scale with zero hue
gray-100: hsl(0, 0%, 96%), gray-200: hsl(0, 0%, 92%) — lifeless, clinical.hsl(217, 91%, 60%)), use gray-100: hsl(217, 8%, 96%). This is how Tailwind slate and Radix mauve/slate work.Mistake 4: Using 8+ colors in a data visualization categorical palette
Mistake 5: Red as a promotional or urgency color alongside red error states
hsl(4, 86%, 52%) and form validation error in hsl(0, 84%, 50%) — both red, different purposes.hsl(25, 95%, 53%)) or amber (hsl(38, 92%, 50%)) for urgency/promotional states. Reserve the red-0°–15° range exclusively for destructive actions and error states.Color Scale Construction
Bad — mathematically uniform HSL steps:
blue-100: hsl(217, 91%, 90%)
blue-300: hsl(217, 91%, 70%)
blue-500: hsl(217, 91%, 50%)
blue-700: hsl(217, 91%, 30%)
blue-900: hsl(217, 91%, 10%)
Problem: 90% and 70% lightness look almost identical (perceptual crowding at top); 10% lightness is nearly black with no visual distinction from 30%.
Good — perceptually uniform (OKLCH-derived, converted to HSL):
blue-50: hsl(214, 100%, 97%)
blue-100: hsl(214, 95%, 93%)
blue-200: hsl(213, 97%, 87%)
blue-300: hsl(212, 96%, 78%)
blue-400: hsl(213, 94%, 68%)
blue-500: hsl(217, 91%, 60%)
blue-600: hsl(221, 83%, 53%)
blue-700: hsl(224, 76%, 48%)
blue-800: hsl(226, 71%, 40%)
blue-900: hsl(224, 64%, 33%)
Note saturation varies slightly and hue shifts subtly — this is correct OKLCH-to-HSL conversion behavior.
Dark Mode Adaptation
Bad:
/* Light */
--color-surface: hsl(0, 0%, 100%);
--color-accent: hsl(258, 90%, 66%); /* Purple */
/* Dark — naive inversion */
--color-surface: hsl(0, 0%, 0%);
--color-accent: hsl(258, 90%, 34%); /* Too dark, unreadable */
Good:
/* Light */
--color-surface: hsl(0, 0%, 100%);
--color-accent: hsl(258, 90%, 66%);
/* Dark — desaturate + shift lightness up, lift surface off pure black */
--color-surface: hsl(258, 10%, 12%); /* Warm-tinted dark surface */
--color-accent: hsl(258, 70%, 72%); /* Lighter, less saturated — still passes 4.5:1 on dark surface */
Contrast Ratio Check
Bad: color: hsl(39, 100%, 50%) (amber/yellow) on white — contrast ratio ~1.9:1. Fails all WCAG levels.
Good: color: hsl(39, 100%, 28%) (dark amber) on white — contrast ratio ~7.1:1. Passes AAA.
hsl(*, *, 8–14%) with a slight brand hue tinthsl(0, 0%, *)--color-error, --color-success) exist as an abstraction layer over primitive tokens