What problem does it solve?
Ensuring sufficient color contrast is crucial for web accessibility (WCAG compliance) but can be a manual and error-prone process. This skill automates the calculation and validation of contrast ratios, helping designers and developers meet accessibility standards effortlessly.
Core Features & Use Cases
- WCAG Compliance Check: Calculates contrast ratios between any two CSS colors and reports compliance against WCAG AA and AAA levels for normal and large text.
- Flexible Color Input: Accepts various CSS color formats including hex, RGB, HSL, and named colors.
- Automated Accessibility Audit: Quickly verify if your UI color combinations are accessible, preventing issues for users with visual impairments.
- Use Case: Before finalizing a new UI theme, use this skill to check if the text color on a button background meets WCAG AA standards, ensuring readability for all users.
Quick Start
Check the WCAG contrast ratio between a dark blue foreground and a light gray background.
uv run --script check_contrast.py --foreground "darkblue" --background "lightgray"