a11y-toolkit: Contrast ratio + verdicts
a11y_contrast_pairCalculate WCAG contrast ratio for any color pair and verify AA, AAA, and non-text compliance. Offers a passing color suggestion when AA fails.
Instructions
Exact WCAG contrast ratio for a color pair: per-criterion verdicts 1.4.3 (AA), 1.4.6 (AAA), 1.4.11 (non-text). Accepts #hex, rgb(), hsl(), CSS color names; rgba/hsl with alpha is composited over the background. If AA fails, suggests the nearest passing color. — For flat pairs; text over images needs a11y_contrast_image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bg | Yes | Background color: same formats; alpha composites over white | |
| fg | Yes | Foreground/text color: #hex, rgb(), hsl() or a CSS color name; alpha composites over bg | |
| lang | No | output language (en default) |