skills/wcag-audit-perceivable-color-contrast/SKILL.md
Calculate WCAG contrast ratios for text and non-text elements
npx skillsauth add jkense/agent-skills-wcag wcag-audit-perceivable-color-contrastInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this tool when checking color combinations for WCAG compliance, testing text readability, or validating non-text contrast ratios.
node scripts/calculate.js --foreground "#000000" --background "#FFFFFF"
node scripts/calculate.js --fg "rgb(0,0,0)" --bg "rgb(255,255,255)"
node scripts/calculate.js --fg "#FF0000" --bg "#00FF00" --type "non-text"
node scripts/calculate.js --json '{"foreground": "#000000", "background": "#FFFFFF"}'
--foreground, --fg: Foreground color (hex, rgb, hsl)--background, --bg: Background color (hex, rgb, hsl)--type: "text" (default) or "non-text"--json: JSON input with color propertiesReturns JSON with contrast ratio and WCAG compliance levels:
{
"contrastRatio": 21.0,
"compliance": {
"AA": {
"normal": true,
"large": true
},
"AAA": {
"normal": true,
"large": true
}
},
"colors": {
"foreground": "#000000",
"background": "#FFFFFF"
}
}
$ node scripts/calculate.js --fg "#000000" --bg "#FFFFFF"
Contrast Ratio: 21.0:1
✅ AA Large Text: PASS
✅ AA Normal Text: PASS
✅ AAA Large Text: PASS
✅ AAA Normal Text: PASS
$ node scripts/calculate.js --fg "#FF6B35" --bg "#F7F3E9" --type "non-text"
Contrast Ratio: 3.2:1
✅ Non-text contrast: PASS
For more information about Agent Skills and how they extend AI capabilities.
testing
Route form input and data collection accessibility requirements
testing
Form design accessibility rules for user input and data collection
testing
Route typography accessibility design decisions and requirements
testing
Convert between px, pt, em, rem units with accessibility context