@hegemonart/get-design-done 1.27.7 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +64 -0
- package/agents/design-verifier.md +17 -0
- package/package.json +1 -1
- package/reference/accessibility.md +4 -0
- package/reference/audit-scoring.md +14 -0
- package/reference/color-theory.md +279 -0
- package/reference/composition.md +349 -0
- package/reference/contrast-advanced.md +205 -0
- package/reference/design-system-guidance.md +2 -0
- package/reference/form-patterns.md +2 -0
- package/reference/i18n.md +554 -0
- package/reference/iconography.md +2 -0
- package/reference/motion-interpolate.md +1 -0
- package/reference/palette-catalog.md +2 -0
- package/reference/proportion-systems.md +267 -0
- package/reference/registry.json +35 -0
- package/reference/rtl-cjk-cultural.md +2 -0
- package/reference/style-vocabulary.md +2 -0
- package/reference/typography.md +4 -0
- package/reference/visual-hierarchy-layout.md +4 -0
- package/skills/explore/SKILL.md +31 -0
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "Get Design Done — 5-stage agent-orchestrated design pipeline with 9 connections, handoff-first workflow, bidirectional Figma write-back, 22+ specialized agents, queryable knowledge layer (intel store, dependency analysis, learnings extraction), and a self-improvement loop (reflector, frontmatter + budget feedback, global-skills layer). v1.20.0 ships the SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream, and resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) for rate-limit + 429 + context-overflow recovery. Full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation (auto-tag + GitHub Release + release-time smoke test).",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.28.0"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "get-design-done",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), Claude Design handoff, bidirectional Figma write-back, and a queryable intel store (.design/intel/) for dependency and learnings queries. Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation. Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain.",
|
|
15
|
-
"version": "1.
|
|
15
|
+
"version": "1.28.0",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "hegemonart"
|
|
18
18
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-design-done",
|
|
3
3
|
"short_name": "gdd",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), handoff-first workflow via Claude Design bundles, bidirectional Figma write-back (annotations, Code Connect), queryable intel store (`.design/intel/`) for O(1) design surface lookups, and self-improvement loop (reflector agent, frontmatter + budget feedback, global-skills layer at `~/.claude/gdd/global-skills/`). Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings, reflect, apply-reflections. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows, lint + schema + frontmatter + stale-ref + shellcheck + gitleaks + injection-scan + blocking size-budget) and release automation (auto-tag + GitHub Release + release-time smoke test). Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain. v1.27.7 ships gdd-mcp (Phase 27.7): 12 read-only MCP tools for sub-3s priming.",
|
|
4
|
+
"version": "1.28.0",
|
|
5
|
+
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), handoff-first workflow via Claude Design bundles, bidirectional Figma write-back (annotations, Code Connect), queryable intel store (`.design/intel/`) for O(1) design surface lookups, and self-improvement loop (reflector agent, frontmatter + budget feedback, global-skills layer at `~/.claude/gdd/global-skills/`). Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings, reflect, apply-reflections. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows, lint + schema + frontmatter + stale-ref + shellcheck + gitleaks + injection-scan + blocking size-budget) and release automation (auto-tag + GitHub Release + release-time smoke test). Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain. v1.27.7 ships gdd-mcp (Phase 27.7): 12 read-only MCP tools for sub-3s priming. v1.28.0 (Phase 28): Foundational References Tier 2 — 5 new reference files (color-theory, composition, proportion-systems, i18n, contrast-advanced), 2 verifier i18n probes + 1 explore i18n-readiness probe, 12 additive cross-link insertions across 10 existing references, 2 orthogonal audit-scoring lens-tags (composition_alignment + i18n_readiness).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "hegemonart",
|
|
8
8
|
"url": "https://github.com/hegemonart"
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,70 @@ All notable changes to get-design-done are documented here. Versions follow [sem
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.28.0] — 2026-05-18
|
|
8
|
+
|
|
9
|
+
### Phase 28 — Foundational References Tier 2 — Color, Composition, Proportion, i18n
|
|
10
|
+
|
|
11
|
+
Closes 4 foundational-fundamentals gaps + 1 contrast layer surfaced by the 2026-05-01 huashu-design comparison audit + parallel i18n-coverage audit. Pure content + light agent wiring; no architectural change, no new pillar, no breaking consumer contract.
|
|
12
|
+
|
|
13
|
+
#### New reference files (Wave A + B)
|
|
14
|
+
|
|
15
|
+
- `reference/color-theory.md` (28-01) — color spaces (sRGB / HSL / OKLCH / LCH), 6 harmonies in OKLCH, simultaneous contrast, color-blindness palettes, color interpolation in animation (closes the sRGB muddy-mid-transition problem).
|
|
16
|
+
- `reference/composition.md` (28-02) — rule of thirds, phi / sqrt(2) / sqrt(3) / sqrt(5) root rectangles, Fibonacci, focal-point construction, visual-weight calculus (size x contrast x isolation x complexity), optical-vs-mathematical centering, Z/F/Gutenberg eye-flow patterns.
|
|
17
|
+
- `reference/proportion-systems.md` (28-03) — 4pt / 8pt / sqrt(2) baseline grids, baseline-grid lock, vertical rhythm, modular relationships across type + spacing + sizing + radius.
|
|
18
|
+
- `reference/i18n.md` (28-04) — text expansion per locale, CSS logical properties, RTL mirroring + directional-icon flip catalog, bidi isolation, full `Intl.*` family (DateTimeFormat / NumberFormat / PluralRules / RelativeTimeFormat / ListFormat / Collator / Segmenter), ICU MessageFormat, Unicode hygiene, multi-script font stacks, WCAG i18n; spec source for design-verifier + explore probes.
|
|
19
|
+
- `reference/contrast-advanced.md` (28-05) — APCA (WCAG 3 draft) Lc 75/60/45/30 thresholds, why 4.5:1 misranks thin/large/colored text (3 worked examples), dual-target pattern with WCAG 2.1 AA, Lc-to-WCAG conversion table. **Ships at v1.28.0 (D-02 — not deferred).**
|
|
20
|
+
|
|
21
|
+
#### Consumer integration (Wave C — 28-06)
|
|
22
|
+
|
|
23
|
+
- `agents/design-verifier.md` gains `### i18n probes` subsection with 2 probes: hardcoded-string scan (regex catalog matches react-intl / next-intl / i18next / vue-i18n patterns per D-10) + +40% text-overflow simulation (`scrollWidth > clientWidth` check per D-03). Findings tagged `i18n_readiness` (orthogonal lens, NOT a new pillar).
|
|
24
|
+
- `skills/explore/SKILL.md` gains i18n-readiness probe under Step 2 — informational 3-state classification (`framework-managed` / `partial` / `none`) per D-04 + D-11. NO gate, NO blocking.
|
|
25
|
+
- `reference/registry.json` gains 5 new entries (D-05) — round-trip schema enforced.
|
|
26
|
+
- `reference/audit-scoring.md` gains 2 orthogonal lens-tags (D-07) — `composition_alignment` + `i18n_readiness`. NO new pillar, NO weight change.
|
|
27
|
+
- 12 additive cross-link insertions across 10 existing reference files (D-06): `palette-catalog.md` Step 4 -> `color-theory.md`; `motion-interpolate.md` -> `color-theory.md`; `visual-hierarchy-layout.md` (Compositional Grids + Asymmetry) -> `composition.md`; `design-system-guidance.md` -> `proportion-systems.md`; `typography.md` (Type Scale Systems + Variable Fonts) -> `proportion-systems.md` + `i18n.md`; `rtl-cjk-cultural.md` (top-of-file) -> `i18n.md`; `form-patterns.md` -> `i18n.md`; `accessibility.md` (x2) -> `i18n.md` + `contrast-advanced.md`; `iconography.md` -> `composition.md`; `style-vocabulary.md` -> `proportion-systems.md`.
|
|
28
|
+
|
|
29
|
+
#### Decisions locked
|
|
30
|
+
|
|
31
|
+
- D-01 (rejection): No net-new audit pillar — orthogonal lens-tags only on existing pillars.
|
|
32
|
+
- D-02: `contrast-advanced.md` ships at v1.28.0 (not deferred).
|
|
33
|
+
- D-03: Verifier overflow probe uses `scrollWidth > clientWidth` after +40% text expansion (cheap synchronous DOM check, no headless-browser dependency).
|
|
34
|
+
- D-04: Explore i18n probe is informational only — 3-state output (`framework-managed` / `partial` / `none`), no gate, no blocking.
|
|
35
|
+
- D-05: 5 new `reference/registry.json` entries with phase=28.
|
|
36
|
+
- D-06: All 12 cross-link insertions are additive (no removals, no rewordings of existing content).
|
|
37
|
+
- D-07: 2 audit-scoring lens-tags (`composition_alignment` + `i18n_readiness`) — orthogonal to existing pillars, not new pillars.
|
|
38
|
+
- D-08: 4-manifest lockstep at 1.28.0 — `package.json#version`, `.claude-plugin/plugin.json#version`, `.claude-plugin/marketplace.json#metadata.version`, `.claude-plugin/marketplace.json#plugins[0].version` all align. `OFF_CADENCE_VERSIONS.add('1.28.0')` added to `tests/semver-compare.test.cjs`.
|
|
39
|
+
- D-09: Phase 20 baselines unchanged (no new agents/skills/hooks introduced in Phase 28).
|
|
40
|
+
- D-10: Hardcoded-string scan covers react-intl / next-intl / i18next / vue-i18n call-site patterns; false-positive tightening is reflector carry-forward debt.
|
|
41
|
+
- D-11: Explore probe is single-shot per run (no caching, no telemetry pinning).
|
|
42
|
+
- D-12: ROADMAP scoped flip — 7 inline plan checkboxes (28-01..28-07) + 1 top-level overview entry. STRICTLY bounded to Phase 28; other phases' `[ ]` markers untouched.
|
|
43
|
+
|
|
44
|
+
#### Tests added
|
|
45
|
+
|
|
46
|
+
- `tests/phase-28-probes.test.cjs` — 21 tests (28-06): verifier i18n probes, explore i18n-readiness probe, 5 registry entries, cross-link integrity across 12 insertions, audit-scoring lens-tags.
|
|
47
|
+
- `tests/phase-28-baseline.test.cjs` — 8 tests (28-07): 4-manifest alignment, baseline file presence, reference file presence, registry round-trip, cross-link integrity, verifier + explore probe markers, CHANGELOG block at top, OFF_CADENCE recognition. Version-agnostic (reads `package.json#version` dynamically — D-08 lesson).
|
|
48
|
+
- `test-fixture/baselines/phase-28/` — 6 baseline text files: `reference-files-presence.txt`, `registry-diff.txt`, `cross-link-integrity.txt`, `verifier-probes-presence.txt`, `explore-probe-presence.txt`, `manifests-version.txt`.
|
|
49
|
+
|
|
50
|
+
#### Out of scope (deferred or rejected)
|
|
51
|
+
|
|
52
|
+
- 20 designer-school philosophies catalog (huashu-design license unresolved).
|
|
53
|
+
- Brand asset acquisition protocol (5-10-2-8 curation rule — separate phase).
|
|
54
|
+
- Color-management profiles (Display-P3 / Rec.2020 / BT.2100 — video/print only).
|
|
55
|
+
- Generative color systems (Material You algorithm — already in `style-vocabulary.md`).
|
|
56
|
+
- Net-new audit pillar (lens-tags instead, per D-07).
|
|
57
|
+
- Translation-management workflows (Crowdin / Lokalise / Phrase — ops concern).
|
|
58
|
+
- Locale-pack bundling / lazy-loading (production tuning concern).
|
|
59
|
+
- Pseudolocalization tooling (+40% overflow at verifier layer covers same QA goal).
|
|
60
|
+
- RTL typography subtleties beyond mirroring (Arabic kashida, vertical CJK — `rtl-cjk-cultural.md` already touches).
|
|
61
|
+
|
|
62
|
+
#### Carry-forward debt
|
|
63
|
+
|
|
64
|
+
- Verifier hardcoded-string scan false-positive rate (D-10) — reflector measures over first N runs; tightens regex per Phase 11 self-improvement loop.
|
|
65
|
+
- APCA spec ratification — currently WCAG 3 draft; if it advances to candidate-recommendation, `contrast-advanced.md` becomes more authoritative.
|
|
66
|
+
- ICU MessageFormat 2.0 status — currently Stage 3 / draft at TC39; if it lands, `i18n.md` ICU section may add 2.0 examples in a follow-up.
|
|
67
|
+
- `Intl.Segmenter` browser-support drift — Safari shipped late; polyfill/fallback note may need adding to `i18n.md` Unicode Hygiene section.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
7
71
|
## [1.27.7] — 2026-05-18
|
|
8
72
|
|
|
9
73
|
### Added
|
|
@@ -161,6 +161,23 @@ Before → After
|
|
|
161
161
|
━━━━━━━━━━━━━━━━━━━━━
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
+
### i18n probes
|
|
165
|
+
|
|
166
|
+
Two additive probes (Phase 28, D-03 — orthogonal `i18n_readiness` lens-tag, NOT a new pillar). Full spec: `./reference/i18n.md` §Verifier Integration Spec; severity rules: `./reference/audit-scoring.md` §Lens-Tags.
|
|
167
|
+
|
|
168
|
+
**Probe 1 — Hardcoded-string scan.** Regex catalog (D-10 patterns):
|
|
169
|
+
|
|
170
|
+
```txt
|
|
171
|
+
react-intl: <FormattedMessage\s+id="[^"]+"
|
|
172
|
+
next-intl: \bt\(\s*['"][a-zA-Z][\w.]*['"]
|
|
173
|
+
i18next: \bt\(\s*['"][a-zA-Z][\w.]*['"]\s*,\s*\{
|
|
174
|
+
vue-i18n: \$t\(\s*['"][a-zA-Z][\w.]*['"]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Allow-list seed (skip): `console\.(log|error|warn|info|debug)`, dev-only `/* */` comments, `data-testid=`, `className=`, `import … from` paths. Severity: `MINOR` per file; `MAJOR` if violating files > 10. Output: `i18n_readiness: <N> hardcoded strings in <M> files`.
|
|
178
|
+
|
|
179
|
+
**Probe 2 — +40% text-overflow simulation.** Worst-case LTR expansion (RU/FI/PL family — `./reference/i18n.md` §Text Expansion). Per text node `T`: pad `T.textContent` to `length × 1.4`, measure `T.parentElement.scrollWidth > clientWidth`, restore original. Prefer Preview MCP screenshot-diff when available; fall back to in-process DOM measurement headless. Severity `MINOR` per finding; `MAJOR` if overflowing components > 10. Output: `i18n_readiness: <N> components overflow at +40% expansion`.
|
|
180
|
+
|
|
164
181
|
---
|
|
165
182
|
|
|
166
183
|
## Phase 2 — Must-Have Check
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hegemonart/get-design-done",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "A design-quality pipeline for AI coding agents: brief, plan, implement, and verify UI work against your design system.",
|
|
5
5
|
"author": "Hegemon",
|
|
6
6
|
"homepage": "https://github.com/hegemonart/get-design-done",
|
|
@@ -25,6 +25,8 @@ Common pitfalls:
|
|
|
25
25
|
|
|
26
26
|
Tools: Use browser DevTools > Accessibility tab, or pass hex values through contrast calculation.
|
|
27
27
|
|
|
28
|
+
**See also:** [`./contrast-advanced.md`](./contrast-advanced.md) — APCA (WCAG 3 draft) for perceptual contrast when WCAG 2.1 4.5:1 misranks thin/large/colored text. Recommended dual-target pattern: enforce WCAG 2.1 AA as a floor + APCA Lc-thresholds (75 / 60 / 45 / 30) for perceptual accuracy.
|
|
29
|
+
|
|
28
30
|
### Touch Target Size
|
|
29
31
|
|
|
30
32
|
| Platform | Minimum tap target |
|
|
@@ -75,6 +77,8 @@ Recommended focus ring: **3px solid**, `2px offset`, brand primary or `#2563eb`.
|
|
|
75
77
|
- Images have descriptive `alt=""` for meaningful images; `alt=""` for decorative.
|
|
76
78
|
- Icon-only buttons have `aria-label`: `<button aria-label="Close dialog">×</button>`.
|
|
77
79
|
|
|
80
|
+
**See:** [`./i18n.md`](./i18n.md) §WCAG i18n for SC 3.1.1 (`<html lang>`) and SC 3.1.2 (`<span lang="…">` language-of-parts) patterns — screen readers select voice/pronunciation packs from these attributes; a missing or wrong `lang` value forces the user to hear French announced in an English accent.
|
|
81
|
+
|
|
78
82
|
### Color Must Not Be The Only Differentiator
|
|
79
83
|
|
|
80
84
|
Error states: red color + error icon + text message (not just red border).
|
|
@@ -234,3 +234,17 @@ Check for (see `reference/checklists.md` Micro-Polish Check gate):
|
|
|
234
234
|
- No `transition: all` (BAN-12)
|
|
235
235
|
- No `will-change: all` (BAN-13)
|
|
236
236
|
- `prefers-reduced-motion` respected
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Lens-Tags (Orthogonal)
|
|
241
|
+
|
|
242
|
+
Tags auditors attach to findings under existing pillars to record cross-cutting dimensions without changing the pillar structure or weights. Same orthogonal pattern as Phase 19.6 `emotion_levels` and `authoring_principles`. Adding a lens-tag does NOT change pillar weights, scoring math, or audit output format — it is a label on an existing finding.
|
|
243
|
+
|
|
244
|
+
### `composition_alignment`
|
|
245
|
+
|
|
246
|
+
Attach to findings under the Visual Hierarchy pillar that relate to compositional fundamentals (rule of thirds, golden ratio, root rectangles, focal-point construction, visual-weight calculus, optical-vs-mathematical centering, eye-flow patterns). See [`./composition.md`](./composition.md) for the rubric. Does NOT change the pillar weight or score; it is an orthogonal tag on the existing finding.
|
|
247
|
+
|
|
248
|
+
### `i18n_readiness`
|
|
249
|
+
|
|
250
|
+
Attach to findings under the Accessibility pillar (for WCAG 3.1.1 / 3.1.2 violations) or under the Anti-Pattern Compliance pillar (for hardcoded-string / overflow-at-+40% defects). Emitted by the `agents/design-verifier.md` §i18n probes section (Phase 28-06). See [`./i18n.md`](./i18n.md) §WCAG i18n + §Verifier Integration Spec. Does NOT change pillar weights or scores.
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: color-theory
|
|
3
|
+
type: palette
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
phase: 28
|
|
6
|
+
tags: [color, oklch, harmonies, accessibility, motion]
|
|
7
|
+
last_updated: 2026-05-18
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Color Theory
|
|
11
|
+
|
|
12
|
+
The existing [palette catalog](./palette-catalog.md) gives industry-vertical lookup — read a row, adopt the baseline tokens, ship. This file gives the underlying model so an agent can reason about color *before* applying it: which color space to author in, how to construct a harmony that holds together under motion and across viewing conditions, how surrounding context shifts perception, which hue pairs collapse under common color-blindness, and why default sRGB interpolation produces muddy mid-transitions in animation. Where the catalog says "shift the primary hue ±15°", this file replaces that hand-wave with explicit OKLCH ΔL/ΔC/Δh guidance.
|
|
13
|
+
|
|
14
|
+
This is the file an agent should consult any time it is *constructing* color — picking a new palette, generating a harmony, animating a color, or auditing a contrast pair under the color-blindness lens.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Color Spaces — sRGB / HSL / OKLCH / LCH
|
|
19
|
+
|
|
20
|
+
Color is not one thing. Every "color" lives in some color space, and every color space makes a trade between three concerns: device gamut (what monitors can actually display), authoring ergonomics (what a human can predict from the numbers), and perceptual uniformity (whether equal numeric jumps produce equal perceived jumps). Choosing the wrong space costs hours of token tweaking and produces palettes that drift under interpolation.
|
|
21
|
+
|
|
22
|
+
### sRGB
|
|
23
|
+
|
|
24
|
+
sRGB is the device-coordinate space — three channels (`r`, `g`, `b`), each `0–255` or `0–1`, mapped onto the standard-monitor gamut defined by IEC 61966-2-1 (1996). It models *what the monitor emits*, not *what the eye perceives*. Equal numeric jumps are not equal perceptual jumps: stepping `rgb(50 50 50)` → `rgb(100 100 100)` looks like a much larger lightness change than `rgb(200 200 200)` → `rgb(250 250 250)`, even though both are a +50 step. Use sRGB only at the output layer (final compiled CSS), not as the authoring space for a palette.
|
|
25
|
+
|
|
26
|
+
### HSL
|
|
27
|
+
|
|
28
|
+
HSL was the first authoring-friendly attempt: three channels (`h` 0–360°, `s` 0–100%, `l` 0–100%) that decompose color into hue, saturation, and lightness — the dimensions a human reasons in. The catch: HSL's `l` is *not* perceptual lightness. `hsl(60 100% 50%)` (pure yellow) and `hsl(240 100% 50%)` (pure blue) both have `l: 50%`, but yellow looks vastly brighter than blue at identical `l`. This means a design instruction like "shift hue 30°, hold lightness constant" can produce wildly different perceived lightnesses across hue ranges. HSL is fine for quick mental math; it is wrong for token-system construction.
|
|
29
|
+
|
|
30
|
+
### OKLCH
|
|
31
|
+
|
|
32
|
+
OKLCH is the modern authoring default: three channels (`L` 0–1 perceptual lightness, `C` 0–~0.4 chroma, `h` 0–360°), built on the Oklab perceptual color space (Ottosson, 2020). Three properties make it the right choice for design tokens:
|
|
33
|
+
|
|
34
|
+
1. **Perceptual uniformity in L.** `oklch(0.6 0 0)` and `oklch(0.6 0.2 240)` have the same perceived lightness, regardless of hue. "Hold lightness constant while shifting hue" finally means what it says.
|
|
35
|
+
2. **Independent C and h axes.** Adjusting chroma does not drift lightness; rotating hue does not drift either. Token systems become predictable.
|
|
36
|
+
3. **Wide-gamut aware.** OKLCH expresses Display-P3 and Rec.2020 colors that sRGB cannot represent, while remaining a single authoring space.
|
|
37
|
+
|
|
38
|
+
Browser support: CSS Color Module 4 `oklch(L C H)` shipped in Safari 15.4, Chrome 111, Firefox 113 — already production-safe for token authoring with sRGB fallback.
|
|
39
|
+
|
|
40
|
+
### LCH
|
|
41
|
+
|
|
42
|
+
LCH (CIE Lab-based) is OKLCH's older sibling: same three-axis structure (`L`, `C`, `h`), built on the 1976 CIE L*a*b* color space. It is perceptually uniform but has well-documented hue-rotation kinks in the blue range — straight-line hue interpolation through LCH visibly bends toward purple. OKLCH was specifically designed to fix this. Use LCH only when matching an existing print or video pipeline; otherwise prefer OKLCH.
|
|
43
|
+
|
|
44
|
+
### Concrete CSS — the same color in four spaces
|
|
45
|
+
|
|
46
|
+
Using `#1A56DB` from the FinTech/Banking row of [./palette-catalog.md](./palette-catalog.md) as the authoritative primary:
|
|
47
|
+
|
|
48
|
+
```css
|
|
49
|
+
/* The same color, four spaces. Author in OKLCH; output sRGB for fallback. */
|
|
50
|
+
.primary-srgb { color: rgb(26 86 219); } /* device coordinates */
|
|
51
|
+
.primary-hsl { color: hsl(222 81% 48%); } /* hue/sat/light, non-perceptual L */
|
|
52
|
+
.primary-oklch { color: oklch(0.488 0.215 263.5); } /* perceptual L, predictable C and h */
|
|
53
|
+
.primary-lch { color: lch(38 71 290); } /* legacy perceptual, blue-rotation kink */
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
/* Token-system pattern — author OKLCH, ship sRGB fallback in the same declaration. */
|
|
58
|
+
:root {
|
|
59
|
+
--color-primary: #1A56DB; /* sRGB fallback */
|
|
60
|
+
--color-primary: oklch(0.488 0.215 263.5); /* OKLCH wins where supported */
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Color Harmonies
|
|
67
|
+
|
|
68
|
+
All six harmonies expressed in OKLCH — adjust hue offset while holding `L` and `C` constant for perceptual stability. The hue offset is what defines the harmony; the lightness and chroma stay anchored so the relationship reads as a *family*, not a collision.
|
|
69
|
+
|
|
70
|
+
### Complementary
|
|
71
|
+
|
|
72
|
+
Two hues separated by 180°. Maximum hue contrast, used for accent pairs and dual-action layouts.
|
|
73
|
+
|
|
74
|
+
Formula: `h + 180°`, hold `L` and `C` constant.
|
|
75
|
+
|
|
76
|
+
```css
|
|
77
|
+
/* Base from FinTech row of ./palette-catalog.md (primary navy + complementary amber accent). */
|
|
78
|
+
:root {
|
|
79
|
+
--primary: oklch(0.488 0.215 263.5); /* navy */
|
|
80
|
+
--complementary: oklch(0.488 0.215 83.5); /* amber, +180° */
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Analogous
|
|
85
|
+
|
|
86
|
+
Three hues at small offsets — typically 30°. Reads as a single mood with internal modulation; ideal for backgrounds, illustrations, and gentle gradients.
|
|
87
|
+
|
|
88
|
+
Formula: `[h - 30°, h, h + 30°]`, hold `L` and `C` constant.
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
/* Base from Healthcare row of ./palette-catalog.md (clinical green + neighbors). */
|
|
92
|
+
:root {
|
|
93
|
+
--analog-a: oklch(0.65 0.15 132); /* yellow-green */
|
|
94
|
+
--analog-b: oklch(0.65 0.15 162); /* green (anchor) */
|
|
95
|
+
--analog-c: oklch(0.65 0.15 192); /* teal */
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Triadic
|
|
100
|
+
|
|
101
|
+
Three hues evenly spaced 120° apart. High visual energy, balanced — used for playful brand systems and category color coding.
|
|
102
|
+
|
|
103
|
+
Formula: `[h, h + 120°, h + 240°]`, hold `L` and `C` constant.
|
|
104
|
+
|
|
105
|
+
```css
|
|
106
|
+
/* Base anchored on the SaaS/B2B row periwinkle of ./palette-catalog.md. */
|
|
107
|
+
:root {
|
|
108
|
+
--triad-a: oklch(0.6 0.18 280); /* periwinkle */
|
|
109
|
+
--triad-b: oklch(0.6 0.18 40); /* warm coral, +120° */
|
|
110
|
+
--triad-c: oklch(0.6 0.18 160); /* fresh green, +240° */
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Split-complement
|
|
115
|
+
|
|
116
|
+
A base hue plus the two hues flanking its complement (180° ± 30°). Retains complementary tension without the dual-action visual collision; the workhorse harmony for dashboards and content-heavy product surfaces.
|
|
117
|
+
|
|
118
|
+
Formula: `[h, h + 150°, h + 210°]`, hold `L` and `C` constant.
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
/* Base from the Developer Tools row of ./palette-catalog.md (near-black + warm pair). */
|
|
122
|
+
:root {
|
|
123
|
+
--split-base: oklch(0.6 0.16 260); /* cool blue */
|
|
124
|
+
--split-a: oklch(0.6 0.16 50); /* warm amber, base + 150° */
|
|
125
|
+
--split-b: oklch(0.6 0.16 110); /* lime green, base + 210° */
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Tetradic
|
|
130
|
+
|
|
131
|
+
Four hues forming a rectangle on the hue wheel — two complementary pairs offset from each other. Very rich; demands one dominant hue and three accents at lower chroma to avoid noise.
|
|
132
|
+
|
|
133
|
+
Formula: `[h, h + 60°, h + 180°, h + 240°]`, hold `L` and `C` constant.
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
/* Base anchored on the Gaming/Entertainment row of ./palette-catalog.md (violet primary). */
|
|
137
|
+
:root {
|
|
138
|
+
--tetra-a: oklch(0.55 0.2 300); /* violet (dominant) */
|
|
139
|
+
--tetra-b: oklch(0.55 0.12 0); /* red-magenta, +60° (accent, reduced chroma) */
|
|
140
|
+
--tetra-c: oklch(0.55 0.12 120); /* green, +180° (accent) */
|
|
141
|
+
--tetra-d: oklch(0.55 0.12 180); /* teal, +240° (accent) */
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Monochromatic
|
|
146
|
+
|
|
147
|
+
One hue, varied only in `L` and/or `C`. Reads as a single material expressed across light and dark surfaces. The natural pattern for elevation systems and dense data displays.
|
|
148
|
+
|
|
149
|
+
Formula: hold `h` constant; vary `L` across `0.95 → 0.15` for a 9-step scale; optionally taper `C` near the L extremes (high `C` collapses to neutral as `L → 1` or `L → 0`).
|
|
150
|
+
|
|
151
|
+
```css
|
|
152
|
+
/* Base from the Luxury/Fashion row of ./palette-catalog.md (near-black scale). */
|
|
153
|
+
:root {
|
|
154
|
+
--mono-50: oklch(0.97 0.005 270);
|
|
155
|
+
--mono-200: oklch(0.88 0.02 270);
|
|
156
|
+
--mono-400: oklch(0.7 0.04 270);
|
|
157
|
+
--mono-600: oklch(0.5 0.06 270);
|
|
158
|
+
--mono-800: oklch(0.3 0.05 270);
|
|
159
|
+
--mono-950: oklch(0.15 0.02 270);
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### When to use which
|
|
164
|
+
|
|
165
|
+
- **Single brand voice, calm:** monochromatic or analogous.
|
|
166
|
+
- **Two clear actions (primary vs. destructive):** complementary.
|
|
167
|
+
- **Three-category coding (status: ok / warn / error):** triadic.
|
|
168
|
+
- **Dashboard with one hero accent + supporting hues:** split-complement.
|
|
169
|
+
- **Editorial / illustrative / rich brand:** tetradic — but reduce chroma on three of the four hues.
|
|
170
|
+
- **Token system primarily expressing depth, not category:** monochromatic, scaled across `L`.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Simultaneous Contrast and Warm-Cool Effects
|
|
175
|
+
|
|
176
|
+
Color is never seen in isolation. The eye continuously normalizes color relative to its surround — a phenomenon Josef Albers documented exhaustively in *Interaction of Color* (1963) and which the perceptual literature calls *simultaneous contrast*. The same OKLCH value placed against a darker surround reads *lighter and more saturated* than placed against a lighter surround; against a complementary surround, hue itself shifts. Token-level lesson: a contrast ratio measured against pure white at design time is not the contrast a user perceives at runtime in a card-on-card-on-background layout.
|
|
177
|
+
|
|
178
|
+
```css
|
|
179
|
+
/* Same foreground token, two surrounds. The same token reads as a different color. */
|
|
180
|
+
.fg-on-light {
|
|
181
|
+
background: oklch(0.97 0.01 270); /* near-white surround */
|
|
182
|
+
color: oklch(0.6 0.15 30); /* warm coral — appears darker and richer */
|
|
183
|
+
}
|
|
184
|
+
.fg-on-dark {
|
|
185
|
+
background: oklch(0.18 0.02 270); /* near-black surround */
|
|
186
|
+
color: oklch(0.6 0.15 30); /* same OKLCH — appears lighter and more luminous */
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Warm-cool effects are simultaneous contrast's spatial cousin. Warm hues (red through yellow, OKLCH `h` roughly 0–90°) read as *advancing* — they appear closer to the viewer; cool hues (green through blue, OKLCH `h` roughly 140–270°) read as *receding*. Place a warm accent against a cool field and the accent leaps forward; reverse the relationship and the same hue retreats. Use this deliberately: warm accents pull the eye to primary actions and selected states; cool accents recede appropriately for ambient information, hover states, and large background fields where you do not want the surface competing for attention.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Color-Blindness — Deutan / Protan / Tritan
|
|
195
|
+
|
|
196
|
+
Color-vision deficiency is common — roughly 8% of males and 0.5% of females of Northern European descent have some form. The three clinical types collapse different hue pairs:
|
|
197
|
+
|
|
198
|
+
- **Deutan** (deuteranomaly / deuteranopia, ~6% of males — the most common): reduced green sensitivity. Confuses red-green pairs at similar lightness, and green-brown at similar saturation.
|
|
199
|
+
- **Protan** (protanomaly / protanopia, ~1% of males): reduced red sensitivity. Confuses red-green pairs; reds appear darker than to typical vision.
|
|
200
|
+
- **Tritan** (tritanomaly / tritanopia, very rare, <0.01%): reduced blue sensitivity. Confuses blue-yellow pairs and blue-green pairs.
|
|
201
|
+
|
|
202
|
+
Token-level guidance:
|
|
203
|
+
|
|
204
|
+
1. **Never encode status with red/green alone at similar `L`.** A red-green status pair where both tokens sit at `oklch(0.6 …)` is invisible to a deutan viewer. Either separate `L` by at least 0.15, or distinguish with an icon/shape.
|
|
205
|
+
2. **Prefer hue pairs separated by ≥ 120° in OKLCH `h` for category coding.** Red (`h ≈ 30°`) vs. blue (`h ≈ 260°`) is ~230° apart and reads reliably across all three types. Red (`h ≈ 30°`) vs. green (`h ≈ 140°`) is only ~110° apart and collapses under deutan.
|
|
206
|
+
3. **Test the destructive / success pair under deutan simulation.** If a deutan filter renders them indistinguishable, raise their lightness contrast.
|
|
207
|
+
4. **Add a non-color carrier.** Icons, underlines, bold weight, position — color must never be the *only* differentiator (WCAG 1.4.1, Use of Color).
|
|
208
|
+
|
|
209
|
+
A good starting palette is the **Wong 8-color CB-safe palette** (Bang Wong, *Nature Methods* 2011) — designed for scientific visualization to remain distinguishable under all three CVD types. Concrete OKLCH approximations of three of its colors for direct use in a token system:
|
|
210
|
+
|
|
211
|
+
```css
|
|
212
|
+
/* Three of the 8 Wong CB-safe palette colors, approximated in OKLCH. */
|
|
213
|
+
:root {
|
|
214
|
+
--cb-blue: oklch(0.55 0.13 240); /* Wong "blue" — #0072B2 */
|
|
215
|
+
--cb-orange: oklch(0.74 0.15 60); /* Wong "orange" — #E69F00 */
|
|
216
|
+
--cb-green: oklch(0.58 0.13 160); /* Wong "bluish green" — #009E73 */
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
See [./accessibility.md](./accessibility.md) for the WCAG intersection — color must not be the only differentiator (WCAG 1.4.1), and the chosen pair must still satisfy 4.5:1 body-text and 3:1 UI-element contrast thresholds at any combination used.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Color Interpolation in Animation
|
|
225
|
+
|
|
226
|
+
Animating from one color to another is interpolation across a color space, and the choice of space changes what the user sees mid-transition. When CSS animates `background-color` from red to green in default sRGB, the midpoint becomes muddy gray — sRGB's interpolation path crosses the desaturated valley between hues, dragging chroma toward 0 at the midpoint. The same animation in OKLCH walks a perceptually-clean arc along the hue wheel, preserving chroma and lightness across the transition. The user never sees gray.
|
|
227
|
+
|
|
228
|
+
```css
|
|
229
|
+
/* BAD — default interpolation space is sRGB. Red → green midpoint is muddy gray. */
|
|
230
|
+
.bad {
|
|
231
|
+
background: red;
|
|
232
|
+
transition: background-color 600ms ease;
|
|
233
|
+
}
|
|
234
|
+
.bad:hover { background: green; }
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```css
|
|
238
|
+
/* GOOD — explicit OKLCH interpolation. Red → green midpoint stays chromatic. */
|
|
239
|
+
.good {
|
|
240
|
+
background: oklch(0.6 0.22 25); /* red in OKLCH */
|
|
241
|
+
transition: background-color 600ms ease; /* honored when --start/--end are OKLCH */
|
|
242
|
+
}
|
|
243
|
+
.good:hover { background: oklch(0.6 0.22 145); } /* green in OKLCH, same L and C */
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```css
|
|
247
|
+
/* GOOD — explicit interpolation space via color-mix(in oklch, …). */
|
|
248
|
+
.fade {
|
|
249
|
+
background: color-mix(in oklch, oklch(0.6 0.22 25) 50%, oklch(0.6 0.22 145));
|
|
250
|
+
/* The 50% midpoint is a clean chromatic yellow-green, not gray. */
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
```css
|
|
255
|
+
/* GOOD — CSS Color Module 4 explicit interpolation hint on a gradient. */
|
|
256
|
+
.bar {
|
|
257
|
+
background: linear-gradient(in oklch to right, oklch(0.6 0.22 25), oklch(0.6 0.22 145));
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Lab-based interpolation (`in lab` or `in oklab`) is also chromatically clean and is the right choice when matching a print pipeline; OKLCH is the right choice for everything else because hue stays on the perceptual wheel and lightness stays steady. Avoid `in hsl` for cross-hue interpolation — it inherits HSL's non-perceptual lightness and produces lightness drift across hue families.
|
|
262
|
+
|
|
263
|
+
Practical defaults:
|
|
264
|
+
|
|
265
|
+
- **Same-hue intensity changes** (e.g., disabled → enabled, hover): any space is acceptable; OKLCH is still preferred for predictability.
|
|
266
|
+
- **Cross-hue transitions** (status changes, theme swaps, brand-moment flourishes): mandate `in oklch` or `color-mix(in oklch, …)`. Default sRGB is the muddy-mid bug.
|
|
267
|
+
- **Dark-mode swap animations**: mandate `in oklch` for the same reason — sRGB midpoints across the L extremes are visibly grayed.
|
|
268
|
+
|
|
269
|
+
See [./motion-interpolate.md](./motion-interpolate.md) for the cross-system motion-interpolation discipline that owns interpolation rules across spaces (timing, easing, value mapping). That file owns the interpolation rules; this section owns the color-specific reasoning.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Cross-References
|
|
274
|
+
|
|
275
|
+
- [./palette-catalog.md](./palette-catalog.md) — industry-vertical lookup table; this file replaces its Step 4 "shift hue ±15°" instruction with explicit OKLCH ΔL/ΔC/Δh guidance and supplies the underlying color-space model.
|
|
276
|
+
- [./motion-interpolate.md](./motion-interpolate.md) — cross-system motion-interpolation discipline; this file's §Color Interpolation in Animation links out to it for the broader interpolation rules.
|
|
277
|
+
- [./accessibility.md](./accessibility.md) — WCAG 2.1 thresholds; this file's §Color-Blindness section intersects with WCAG 1.4.1 (Use of Color) and 1.4.3 (Contrast Minimum).
|
|
278
|
+
|
|
279
|
+
Reciprocal inbound cross-links land in Phase 28-06 (additive-only, D-06) — the other files will gain pointers back to this one without altering their existing content.
|