WCAG Color Contrast Checker API - AA/AAA Ratio, APCA & Auto-Fix Palette Matrix
color_contrast_checkerCalculate WCAG 2.1 relative luminance and contrast ratio (AA/AAA normal & large text + UI components) plus APCA Lc perceptual contrast for HEX, RGB, HSL, or named CSS colors. Returns closest passing auto-fix HEX suggestions when a pair fails, and an optional NxN brand palette matrix (up to 15 colors). 0 AI, deterministic, < 5 ms. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/color-contrast-checker.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"palette": [
"#1E3A8A",
"#FFFFFF",
"#F59E0B",
"#111827"
],
"background": "#FFFFFF",
"foreground": "#1E3A8A"
},
"name": "color_contrast_checker"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| palette | No | Optional list of up to 15 colors to build a full NxN WCAG contrast matrix | |
| background | No | Background color (HEX, RGB, HSL, or CSS name) | #FFFFFF |
| foreground | No | Foreground/text color (HEX, RGB, HSL, or CSS name) | #1E3A8A |