contrast-checker

Analyzes color contrast ratios in code files for WCAG 2.1 compliance.

3|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/langgenius/due-date-hq-jwl --skill contrast-checker-langgenius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contrast-checker
Source: https://github.com/langgenius/due-date-hq-jwl/tree/main/.claude/skills/contrast-checker
Command: npx skills add https://github.com/langgenius/due-date-hq-jwl --skill contrast-checker-langgenius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? UI colors often fail WCAG contrast requirements, making text and components unreadable for users with low vision. This Skill scans your code files, calculates exact contrast ratios, identifies violations, and suggests accessible color replacements that preserve your design theme. ## Core Features & Use Cases - WCAG Compliance Analysis: Calculates contrast ratios and checks them against WCAG 1.4.3 (text) and 1.4.11 (UI components) requirements for normal text, large text, and component boundaries. - Accessible Color Suggestions: Generates compliant alternative hex values that preserve the original hue while adjusting lightness to meet target ratios. - Scoped File Analysis: Analyzes only the files or directories you specify, while searching the wider codebase for color definitions, CSS variables, and design tokens. - Use Case: Point it at a button component file and receive a report showing each failing color pair, its current ratio, the required ratio, and a specific replacement hex value with its new compliant ratio. ## Quick Start Check the color contrast in src/components/PrimaryButton.tsx for WCAG AA compliance and suggest fixes for any violations.

Frequently Asked Questions about contrast-checker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check color contrast for WCAG compliance in my code?

Provide the file paths of your components or style files, and the analyzer extracts color pairs, calculates contrast ratios, and reports pass/fail status against WCAG 1.4.3 and 1.4.11 thresholds with specific fix recommendations.

What contrast ratio is required for WCAG AA compliance?

Normal text requires 4.5:1, large text (18pt or 14pt bold) requires 3:1, and UI component boundaries, states, and icons require 3:1 against adjacent colors. Text inside buttons and inputs must meet text requirements, not the 3:1 component threshold.

Can I analyze an entire codebase for contrast issues at once?

Analysis is scoped to the files or directories you specify to keep reports focused. The tool may search the wider codebase for color definitions, CSS variables, and design tokens referenced by your specified components.

How are accessible color suggestions generated?

The suggestion tool preserves the original color's hue while adjusting lightness until the target contrast ratio is met. You receive specific hex values for foreground or background changes along with the resulting compliant ratio.

Why does a 3.5:1 contrast ratio still fail accessibility checks?

A 3.5:1 ratio passes the 3:1 UI component requirement but fails the 4.5:1 normal text requirement. Text content inside buttons, forms, and other components must meet text thresholds, not the lower component threshold.