[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FDQCD965BVH6Q7NJ3P5BS":3,"skill-same:01M78FDQCD965BVH6Q7NJ3P5BS":73},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78FDQCD965BVH6Q7NJ3P5BS","contrast",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Color Contrast Verification & Perceptual Legibility (WCAG 2.2 & APCA)\n\n## 1. Purpose\nVerify, audit, and mathematically validate color contrast ratios across all user interfaces, graphical components, and interactive states. This skill enforces strict compliance with **WCAG 2.2 Success Criteria 1.4.3 (Contrast Minimum), 1.4.11 (Non-text Contrast), and 1.4.1 (Use of Color)**, integrates the Advanced Perceptual Contrast Algorithm (APCA), validates alpha-blended composite surfaces, and verifies multi-hue legibility under color blindness simulations (Protanopia, Deuteranopia, Tritanopia).\n\n---\n\n## 2. Use When\n- Auditing UI designs, design tokens, web pages, or desktop application themes for accessibility compliance.\n- Verifying focus ring indicators, input borders, button states, and graphical charts against adjacent surfaces.\n- Calculating effective contrast on semi-transparent overlays, glassmorphic surfaces, or gradient backgrounds.\n- Testing that color is never the sole visual indicator of status, errors, or critical alerts.\n- Operating in mode(s): `audit`, `testing`, `review`, `implementation`.\n\n---\n\n## 3. Do Not Use When\n- Designing structural keyboard focus trapping or roving tabindex order (use `keyboard-accessibility` or `focus-management`).\n- Auditing screen reader tree semantics and aria-live announcements (use `screen-reader`).\n- Developing GPU shaders without UI or text rendering.\n\n---\n\n## 4. Required Context\nBefore verifying contrast ratios, verify:\n- **Target Standard**: WCAG 2.2 Level AA (Mandatory: $4.5:1$ text, $3:1$ UI components\u002Flarge text) or Level AAA ($7:1$ text, $4.5:1$ large text).\n- **Text Classification**: Normal body text ($\u003C 18\\text{pt}$ or $\u003C 14\\text{pt}$ bold) vs Large text ($\\ge 18\\text{pt}$ \u002F $\\ge 24\\text{px}$ or $\\ge 14\\text{pt}$ bold \u002F $\\ge 18.5\\text{px}$ bold).\n- **Interactive State Matrix**: Default, Hover, Focus-Visible, Active, Disabled, Error, and Warning states.\n- **Surface Stack**: Composition stack for alpha blending ($C_{\\text{foreground}}$ on $C_{\\text{overlay}}$ on $C_{\\text{background}}$).\n\n---\n\n## 5. Procedure\n\n```\n[UI Design \u002F Token Palette]\n         |\n         v\n[1. Surface Alpha Compositing] -----> Flatten translucent layers to opaque sRGB\n         |\n         v\n[2. Relative Luminance Calculation] -> Linearize RGB components and compute L1, L2\n         |\n         v\n[3. WCAG 2.2 AA\u002FAAA Ratio Check] ---> Verify 4.5:1 (text) and 3.0:1 (UI \u002F focus)\n         |\n         v\n[4. APCA Perceptual Legibility] ----> Check Lc score against font weight & size\n         |\n         v\n[5. Color Blindness & Dual Cue Audit] Protanopia\u002FDeuteranopia simulation + non-color cue\n```\n\n### Step 1: Alpha Flattening & Surface Composition\nWhen text or backgrounds have alpha transparency ($A \u003C 1.0$), compute the effective composite color $C_{\\text{effective}}$ before calculating luminance:\n$$C_{\\text{effective}} = C_{\\text{fg}} \\times A_{\\text{fg}} + C_{\\text{bg}} \\times (1 - A_{\\text{fg}})$$\nIf multiple translucent layers exist, composite them sequentially from background to foreground.\n\n### Step 2: Calculate Relative Luminance & WCAG Ratio\n1. Linearize standard sRGB channels ($R, G, B \\in [0, 1]$):\n   $$C_{\\text{linear}} = \\begin{cases} \\frac{C_{\\text{srgb}}}{12.92} & \\text{if } C_{\\text{srgb}} \\le 0.04045 \\\\ \\left(\\frac{C_{\\text{srgb}} + 0.055}{1.055}\\right)^{2.4} & \\text{if } C_{\\text{srgb}} > 0.04045 \\end{cases}$$\n2. Compute relative luminance:\n   $$L = 0.2126 \\cdot R_{\\text{linear}} + 0.7152 \\cdot G_{\\text{linear}} + 0.0722 \\cdot B_{\\text{linear}}$$\n3. Compute contrast ratio between lighter color $L_1$ and darker color $L_2$:\n   $$\\text{Ratio} = \\frac{L_1 + 0.05}{L_2 + 0.05}$$\n\n### Step 3: Non-Text Contrast Audit (SC 1.4.11)\nAudit interactive UI elements:\n- **Input Borders**: Form inputs with a border must have $\\ge 3:1$ contrast against the adjacent canvas.\n- **Focus Rings**: Focus indicator rings must have $\\ge 3:1$ contrast against both the focused component background and the surrounding canvas.\n- **Icons & Badges**: Standalone icons conveying meaning must have $\\ge 3:1$ contrast against their immediate background.\n\n### Step 4: Perceptual Validation with APCA\nEvaluate readability with the Advanced Perceptual Contrast Algorithm (APCA):\n- Body text ($16\\text{px}$ regular): Minimum $L_c \\ge 75$.\n- Subtitles \u002F bold UI elements ($14\\text{px}$ bold): Minimum $L_c \\ge 60$.\n- Secondary hints \u002F placeholders: Minimum $L_c \\ge 45$.\n\n### Step 5: Color Blindness & Use of Color Check (SC 1.4.1)\n1. Simulate the UI under color vision deficiencies:\n   - **Protanopia** (Long-wave cone deficiency \u002F Red blindness).\n   - **Deuteranopia** (Medium-wave cone deficiency \u002F Green blindness).\n   - **Tritanopia** (Short-wave cone deficiency \u002F Blue blindness).\n2. Enforce dual-coding: Verify that errors, success messages, and required fields are accompanied by an icon, text label, or underline—never color alone.\n\n---\n\n## 6. Decision Rules & Invariants\n- **RULE 1 (Mandatory 4.5:1 for Normal Text)**: Any body text with contrast $\u003C 4.5:1$ against its resolved background fails quality gates immediately.\n- **RULE 2 (Mandatory 3:1 for Focus Rings & Borders)**: Interactive component boundaries and keyboard focus indicators must achieve $\\ge 3:1$ contrast against adjacent surfaces.\n- **RULE 3 (Dual Visual Cue Invariant)**: System states (error, warning, active, dirty) must provide a secondary non-color indicator (icon, badge, border pattern).\n- **RULE 4 (Disabled State Exemption)**: Disabled elements are exempt from SC 1.4.3, but must remain distinguishable from active elements without causing legibility confusion.\n\n---\n\n## 7. Evidence Required\n- **Mathematical Contrast Matrix**: Computed relative luminance and ratio for every foreground\u002Fbackground pair.\n- **Interactive State Scorecard**: Contrast ratios verified across default, hover, focus, and active states.\n- **Dual-Cue Verification**: Documented proof that all status indicators utilize text or icons in addition to color.\n\n---\n\n## 8. Output Contract\n- Color Contrast Audit Report (`templates\u002Fcontrast-report.md`).\n- Pass\u002FFail scorecard covering all theme permutations (Light, Dark, High-Contrast).\n- Remediation patches for non-compliant design tokens or CSS rules.\n\n---\n\n## 9. Stop Conditions\n- 100% of text elements pass WCAG 2.2 AA ($4.5:1$ normal, $3:1$ large).\n- 100% of focus rings and non-text elements pass $3:1$ contrast.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n---\n\n## 10. Escalation Rules\n- Escalate to lead designer if brand guidelines mandate a foreground\u002Fbackground pair that fails the $4.5:1$ threshold.\n- Escalate if graphical data visualization charts cannot maintain $3:1$ contrast across $> 8$ categorical series without pattern fills.\n",{},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".ai\u002Fskills\u002Fcontrast",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill contrast",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill contrast",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill contrast","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002FSKILL.md",true,[45,51,57,61,65,69],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Fcontrast-checklist.md","REFERENCE","参考文档",2242,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Fchecks\u002Fcontrast-checklist.md",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"examples\u002Fcontrast_checker.py","SCRIPT","脚本",3029,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Fexamples\u002Fcontrast_checker.py",{"path":58,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":59,"sourceHtmlUrl":60},"manifest.json",1910,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Fmanifest.json",{"path":62,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fcontrast-guide.md",2799,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Freferences\u002Fcontrast-guide.md",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"scripts\u002Fverify.sh",1534,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Fscripts\u002Fverify.sh",{"path":70,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":71,"sourceHtmlUrl":72},"templates\u002Fcontrast-report.md",2159,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fcontrast\u002Ftemplates\u002Fcontrast-report.md",[74,80,86,93,100,107],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]