Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Check color contrast ratios for WCAG accessibility compliance. Use when: auditing UI components for accessibility, validating color schemes meet AA/AAA standards, fixing low-contrast text in designs.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-20 | ✗→✓ | ▲ Improved | -40% | 0% |
| case-07 | ✓→✗ | ▼ Worse | -45% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 41% | 0% |
Check color pairs against WCAG 2.1 contrast requirements. Pass in hex colors and get contrast ratios with AA/AAA pass/fail results for both normal and large text.
WCAG thresholds:
Run the script with two or more hex colors (with or without # prefix):
bashbash <skill-path>/scripts/contrast-check.sh <color1> <color2> [color3] [color4] ...
The script outputs JSON with contrast ratios and pass/fail results:
json{ "pairs": [ { "foreground": "#1a1a2e", "background": "#ffffff", "ratio": 16.57, "aa": { "normal": true, "large": true }, "aaa": { "normal": true, "large": true } } ], "summary": { "totalPairs": 2, "passAA": 1, "passAAA": 1, "failAA": 1 } }
After checking, present a table to the user:
Contrast Check Results:
#1a1a2e on #ffffff — 16.57:1 — AA: Pass — AAA: Pass
#e94560 on #ffffff — 3.94:1 — AA: Fail (normal) / Pass (large) — AAA: Fail
Summary: 1/2 pairs pass AA for normal text, 1/2 pass AAA.Flag any failing pairs and suggest fixes (darken/lighten the color to reach the threshold).
bashbash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#ffffff"
Output:
json{ "pairs": [ { "foreground": "#1a1a2e", "background": "#ffffff", "ratio": 16.57, "aa": { "normal": true, "large": true }, "aaa": { "normal": true, "large": true } } ], "summary": { "totalPairs": 1, "passAA": 1, "passAAA": 1, "failAA": 0 } }
bashbash <skill-path>/scripts/contrast-check.sh "#1a1a2e" "#e94560" "#ffffff" "#3d83f7" "#bdbdbd"
The script checks all foreground/background combinations and reports which pairs fail AA or AAA. For example, #e94560 on #ffffff yields a ratio of 3.94:1 which fails AA for normal text but passes for large text.
#).image-analysis skill to extract colors from a design first, then pipe the hex values into this skill to audit accessibility.Other measured skills in the registry, with their headline benchmark lift.