Check contrast
colors_checkCheck WCAG contrast for text/background color pairs and get PASS/FAIL, exact ratios, APCA Lc scores, and nearby passing colors for accessibility fixes.
Instructions
Check WCAG 2 contrast for text/background color pairs and say PASS or FAIL for each, with the exact ratio and, for failures, a nearby passing color. Also gives the signed APCA Lc (APCA-W3 0.98G-4g: positive for dark text on light, negative for light on dark). Use whenever you must know if colors are readable or accessible. Handles translucent colors. Pass foreground+background, or pairs for many.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "colors_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Color that translucent backgrounds are composited over. Default "#ffffff". | |
| size | No | "normal" text (default), "large" text (24px or 18.66px bold and up), or "ui" for non-text parts like borders and icons. | normal |
| level | No | WCAG level. Default "AA". | AA |
| pairs | No | Several checks at once: a list of {foreground, background}. Use instead of foreground/background. | |
| background | No | Background color, for a single check. Any CSS color. | |
| foreground | No | Text color, for a single check. Any CSS color. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | ||
| level | Yes | ||
| allPass | Yes | ||
| results | Yes | ||
| required | Yes |