[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7902Y0P6Z8MYAB2719NQ49W":3,"skill-same:01M7902Y0P6Z8MYAB2719NQ49W":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7902Y0P6Z8MYAB2719NQ49W","color-system",null,"Turn a chosen direction into a real palette: tints, WCAG contrast, dark mode mapping, elevation and tokens. Use when building semantic color tokens, dark mode palettes, or contrast scales.","poorvith-mp\u002Fskills-design","poorvith-mp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F277478855?v=4","01M78Z5K0YH1Z3PX815PGQ96ND","Poorvith M P","01M79023NZMHA7EKM9K6KWHEET",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcolor-system\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: color-system\nlast_reviewed: 2026-09-06\ngroup: Design system\ndescription: >-\n  Turn a chosen direction into a real palette: tints, WCAG contrast, dark mode mapping, elevation\n  and tokens. Use when building semantic color tokens, dark mode palettes, or contrast scales.\n---\n\n# color-system\n\n## Core Philosophy\nA production color system is not a static Figma swatch board of 5 favorite hex codes. A true color system is a mathematically coherent, tokenized software architecture. It governs contrast ratios, elevation surface ramps, perceptual lightness distribution, semantic state bindings, and flawless bidirectional light\u002Fdark mode transitions without manual per-screen overrides.\n\n---\n\n## 4-Step Scalable Color System Engineering\n\n### Step 1: The 3-Tier Token Architecture\n1. **The Token Hierarchy**:\n   - *Tier 1: Global Primitives (Raw Values)*:\n     - `blue-500: #3B82F6`, `slate-900: #0F172A`. Never consume primitives directly in components.\n   - *Tier 2: Semantic Tokens (System Purpose)*:\n     - `surface-canvas: var(--slate-900)`, `action-primary: var(--blue-500)`.\n   - *Tier 3: Component Tokens (Scoped Overrides)*:\n     - `button-primary-bg: var(--action-primary)`.\n\n### Step 2: Perceptual Color Spaces (OKLCH) & Shade Generation\n1. **Why sRGB\u002FHSL Fails**:\n   - HSL is mathematically flawed: pure yellow ($H=60$) has vastly higher perceived luminance than pure blue ($H=240$), making consistent lightness across hues impossible.\n2. **The OKLCH Standard**:\n   - Use **OKLCH** (`oklch(L C H)`):\n     - $L$ = Perceptual Lightness (0% to 100%).\n     - $C$ = Chroma \u002F Saturation (0 to ~0.37).\n     - $H$ = Hue angle ($0^\\circ$ to $360^\\circ$).\n   - Generating consistent shades (50 to 950): Fix Hue and Chroma, and step Lightness mathematically from 95% down to 10%.\n\n### Step 3: Elevation Ramps & Dark Mode Surface Parity\n1. **The Elevation Surface Ladder in Dark Mode**:\n   - In light mode, elevation is communicated via drop shadows (`box-shadow`).\n   - In dark mode, shadows are invisible against dark backgrounds. Elevation must be communicated via **surface lightness stepping**:\n     - `surface-base (0dp)`: `oklch(14% 0.02 260)` (Canvas background)\n     - `surface-raised (1dp)`: `oklch(18% 0.02 260)` (Card background)\n     - `surface-overlay (4dp)`: `oklch(22% 0.02 260)` (Dropdown menu)\n     - `surface-modal (8dp)`: `oklch(26% 0.02 260)` (Floating dialog)\n2. **Never Use Pure Black (`#000000`) for Dark Mode**:\n   - Pure black causes harsh pixel smearing on OLED screens and severe contrast strain against pure white text. Use deep slate\u002Fnavy tints ($L \u0007pprox 12–15\\%$).\n\n### Step 4: Semantic State Mapping & Automated Contrast Gates\n1. **Interactive State Offsets**:\n   - Hover: Adjust lightness by $\\pm 5\\%$ in OKLCH.\n   - Pressed \u002F Active: Adjust lightness by $\\pm 10\\%$.\n   - Disabled: Lock Chroma to 0 (grayscale) and set opacity to 40%.\n2. **Contrast Verification**:\n   - Automatically assert that every text semantic token against its assigned surface token achieves $\\ge 4.5:1$ WCAG contrast.\n\n---\n\n## Deliverable Format: Color Tokens Definition (`tokens.css`)\n\n```css\n\u002F* ==========================================================================\n   PRODUCTION COLOR SYSTEM TOKENS (OKLCH)\n   ========================================================================== *\u002F\n\n:root {\n  \u002F* 1. Global Primitives (Indigo Scale) *\u002F\n  --indigo-50:  oklch(96% 0.02 270);\n  --indigo-500: oklch(58% 0.22 270);\n  --indigo-600: oklch(50% 0.22 270);\n  --indigo-900: oklch(24% 0.12 270);\n\n  \u002F* Slate Scale *\u002F\n  --slate-50:  oklch(98% 0.005 250);\n  --slate-100: oklch(94% 0.010 250);\n  --slate-800: oklch(22% 0.020 250);\n  --slate-900: oklch(14% 0.020 250);\n\n  \u002F* 2. Semantic Mappings (Light Mode Default) *\u002F\n  --surface-canvas: var(--slate-50);\n  --surface-card:   #ffffff;\n  --text-primary:   var(--slate-900);\n  --text-muted:     var(--slate-800);\n  --border-subtle:  var(--slate-100);\n  \n  --action-primary-bg:    var(--indigo-500);\n  --action-primary-hover: var(--indigo-600);\n  --action-primary-text:  #ffffff;\n}\n\n\u002F* 3. Dark Mode Overrides (Automatic Surface Inversion) *\u002F\n[data-theme=\"dark\"] {\n  --surface-canvas: var(--slate-900);\n  --surface-card:   var(--slate-800);\n  --text-primary:   var(--slate-50);\n  --text-muted:     var(--slate-100);\n  --border-subtle:  var(--slate-800);\n\n  --action-primary-bg:    var(--indigo-500);\n  --action-primary-hover: var(--indigo-600);\n  --action-primary-text:  #ffffff;\n}\n```\n\n---\n\n## Worked Example: Automated CI Contrast Gate\n\n- **Tooling**: Integrated `stylelint-color-contrast` into frontend test suite.\n- **Detection**: PR attempted to set secondary text to `#888888` on `#FFFFFF` (contrast 3.5:1; fails WCAG AA).\n- **Resolution**: CI failed build automatically; developer adjusted token to `#6B7280` (4.6:1), maintaining full accessibility compliance.\n\n---\n\n## Verification Checklist\n\n- [ ] Tokens structured into 3 distinct tiers (Primitives -> Semantics -> Components).\n- [ ] Color shades generated in perceptual color space (OKLCH or Lab).\n- [ ] Dark mode surfaces use stepped elevation lightness ramps rather than pure black.\n- [ ] All interactive states (Hover, Active, Focus, Disabled) mathematically derived.\n- [ ] Automated tests verify $\\ge 4.5:1$ contrast across all text\u002Fsurface pairings.\n\n---\n\n## Anti-Patterns\n\n- **Hardcoding Hex Codes in Components**: Writing `color: #4F46E5` directly inside a React component stylesheet.\n- **Inverted Dark Mode Negatives**: Inverting black text to white while leaving bright background containers blindingly white.\n- **Pure Black OLED Traps**: Setting `#000000` as the global background, causing severe text smearing on mobile scrolling.\n","# color-system\n\n## Core Philosophy\nA production color system is not a static Figma swatch board of 5 favorite hex codes. A true color system is a mathematically coherent, tokenized software architecture. It governs contrast ratios, elevation surface ramps, perceptual lightness distribution, semantic state bindings, and flawless bidirectional light\u002Fdark mode transitions without manual per-screen overrides.\n\n---\n\n## 4-Step Scalable Color System Engineering\n\n### Step 1: The 3-Tier Token Architecture\n1. **The Token Hierarchy**:\n   - *Tier 1: Global Primitives (Raw Values)*:\n     - `blue-500: #3B82F6`, `slate-900: #0F172A`. Never consume primitives directly in components.\n   - *Tier 2: Semantic Tokens (System Purpose)*:\n     - `surface-canvas: var(--slate-900)`, `action-primary: var(--blue-500)`.\n   - *Tier 3: Component Tokens (Scoped Overrides)*:\n     - `button-primary-bg: var(--action-primary)`.\n\n### Step 2: Perceptual Color Spaces (OKLCH) & Shade Generation\n1. **Why sRGB\u002FHSL Fails**:\n   - HSL is mathematically flawed: pure yellow ($H=60$) has vastly higher perceived luminance than pure blue ($H=240$), making consistent lightness across hues impossible.\n2. **The OKLCH Standard**:\n   - Use **OKLCH** (`oklch(L C H)`):\n     - $L$ = Perceptual Lightness (0% to 100%).\n     - $C$ = Chroma \u002F Saturation (0 to ~0.37).\n     - $H$ = Hue angle ($0^\\circ$ to $360^\\circ$).\n   - Generating consistent shades (50 to 950): Fix Hue and Chroma, and step Lightness mathematically from 95% down to 10%.\n\n### Step 3: Elevation Ramps & Dark Mode Surface Parity\n1. **The Elevation Surface Ladder in Dark Mode**:\n   - In light mode, elevation is communicated via drop shadows (`box-shadow`).\n   - In dark mode, shadows are invisible against dark backgrounds. Elevation must be communicated via **surface lightness stepping**:\n     - `surface-base (0dp)`: `oklch(14% 0.02 260)` (Canvas background)\n     - `surface-raised (1dp)`: `oklch(18% 0.02 260)` (Card background)\n     - `surface-overlay (4dp)`: `oklch(22% 0.02 260)` (Dropdown menu)\n     - `surface-modal (8dp)`: `oklch(26% 0.02 260)` (Floating dialog)\n2. **Never Use Pure Black (`#000000`) for Dark Mode**:\n   - Pure black causes harsh pixel smearing on OLED screens and severe contrast strain against pure white text. Use deep slate\u002Fnavy tints ($L \u0007pprox 12–15\\%$).\n\n### Step 4: Semantic State Mapping & Automated Contrast Gates\n1. **Interactive State Offsets**:\n   - Hover: Adjust lightness by $\\pm 5\\%$ in OKLCH.\n   - Pressed \u002F Active: Adjust lightness by $\\pm 10\\%$.\n   - Disabled: Lock Chroma to 0 (grayscale) and set opacity to 40%.\n2. **Contrast Verification**:\n   - Automatically assert that every text semantic token against its assigned surface token achieves $\\ge 4.5:1$ WCAG contrast.\n\n---\n\n## Deliverable Format: Color Tokens Definition (`tokens.css`)\n\n```css\n\u002F* ==========================================================================\n   PRODUCTION COLOR SYSTEM TOKENS (OKLCH)\n   ========================================================================== *\u002F\n\n:root {\n  \u002F* 1. Global Primitives (Indigo Scale) *\u002F\n  --indigo-50:  oklch(96% 0.02 270);\n  --indigo-500: oklch(58% 0.22 270);\n  --indigo-600: oklch(50% 0.22 270);\n  --indigo-900: oklch(24% 0.12 270);\n\n  \u002F* Slate Scale *\u002F\n  --slate-50:  oklch(98% 0.005 250);\n  --slate-100: oklch(94% 0.010 250);\n  --slate-800: oklch(22% 0.020 250);\n  --slate-900: oklch(14% 0.020 250);\n\n  \u002F* 2. Semantic Mappings (Light Mode Default) *\u002F\n  --surface-canvas: var(--slate-50);\n  --surface-card:   #ffffff;\n  --text-primary:   var(--slate-900);\n  --text-muted:     var(--slate-800);\n  --border-subtle:  var(--slate-100);\n  \n  --action-primary-bg:    var(--indigo-500);\n  --action-primary-hover: var(--indigo-600);\n  --action-primary-text:  #ffffff;\n}\n\n\u002F* 3. Dark Mode Overrides (Automatic Surface Inversion) *\u002F\n[data-theme=\"dark\"] {\n  --surface-canvas: var(--slate-900);\n  --surface-card:   var(--slate-800);\n  --text-primary:   var(--slate-50);\n  --text-muted:     var(--slate-100);\n  --border-subtle:  var(--slate-800);\n\n  --action-primary-bg:    var(--indigo-500);\n  --action-primary-hover: var(--indigo-600);\n  --action-primary-text:  #ffffff;\n}\n```\n\n---\n\n## Worked Example: Automated CI Contrast Gate\n\n- **Tooling**: Integrated `stylelint-color-contrast` into frontend test suite.\n- **Detection**: PR attempted to set secondary text to `#888888` on `#FFFFFF` (contrast 3.5:1; fails WCAG AA).\n- **Resolution**: CI failed build automatically; developer adjusted token to `#6B7280` (4.6:1), maintaining full accessibility compliance.\n\n---\n\n## Verification Checklist\n\n- [ ] Tokens structured into 3 distinct tiers (Primitives -> Semantics -> Components).\n- [ ] Color shades generated in perceptual color space (OKLCH or Lab).\n- [ ] Dark mode surfaces use stepped elevation lightness ramps rather than pure black.\n- [ ] All interactive states (Hover, Active, Focus, Disabled) mathematically derived.\n- [ ] Automated tests verify $\\ge 4.5:1$ contrast across all text\u002Fsurface pairings.\n\n---\n\n## Anti-Patterns\n\n- **Hardcoding Hex Codes in Components**: Writing `color: #4F46E5` directly inside a React component stylesheet.\n- **Inverted Dark Mode Negatives**: Inverting black text to white while leaving bright background containers blindingly white.\n- **Pure Black OLED Traps**: Setting `#000000` as the global background, causing severe text smearing on mobile scrolling.\n",{"name":5,"group":24,"description":7,"last_reviewed":25},"Design system",1788652800000,"main","502b1a762b2c40a4ad7faa6297e2ebf7e4682efc","skills\u002Fcolor-system",1,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskillary","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp","poorvithmp.com","Shipping tools for problems people notice too late.","2026-10-02 21:32:17",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add poorvith-mp\u002Fskills-design --skill color-system",{"tool":42,"command":43},"bunx","bunx skills add poorvith-mp\u002Fskills-design --skill color-system",{"tool":45,"command":46},"pnpm","pnpm dlx skills add poorvith-mp\u002Fskills-design --skill color-system","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcolor-system\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"color-system.skill","OTHER","其他",3225,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcolor-system\u002Fcolor-system.skill",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"evals\u002Frouting.yaml","REFERENCE","参考文档",988,"https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fcolor-system\u002Fevals\u002Frouting.yaml",[63,70,76,82,88,95],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7906MDY214MTS6J24WC9HCM","youtube-thumbnail-maker","Moved to modernized catalog in skillary. Removed in v4.1.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-thumbnail-maker\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7906JSPSGETSSTXYTEDN5GT","youtube-popup-graphic","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-popup-graphic\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7906GYHJ8Z846MTA9FPEVE9","whimsy-injector","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fwhimsy-injector\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7906FK39C4JEE36EXD8R8ZC","visual-storyteller","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-storyteller\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7906D196H7PN42711NX46RE","ux-researcher","Moved to ux-research in skills-design. Removed in v4.1.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fux-researcher\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7906A5DJYRN1P5MQJPNN53K","ux-research","Plan and run usability studies and behavioural analysis, then turn findings into research-backed personas. Use when running usability tests, journey mapping, or observing user behavior.","https:\u002F\u002Fgithub.com\u002Fpoorvith-mp\u002Fskills-design\u002Fblob\u002Fmain\u002Fskills\u002Fux-research\u002FSKILL.md",[],[]]