Check WCAG color contrast
check_contrastRead-onlyIdempotent
Compute the WCAG 2.x contrast ratio between a text (foreground) color and a background color, with pass/fail for AA, AA large text, AAA, AAA large text and non-text UI (3:1). Handles translucent colors. Read-only. Same engine as GET /api/contrast.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| background | Yes | Background color as a CSS color: "#1a73e8", "#fff", "rgb(26 115 232)", "hsl(217 80% 51%)", "rgba(0,0,0,.6)" or a name like "navy". | |
| foreground | Yes | Text / foreground color as a CSS color: "#1a73e8", "#fff", "rgb(26 115 232)", "hsl(217 80% 51%)", "rgba(0,0,0,.6)" or a name like "navy". |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pass | Yes | ||
| notes | Yes | ||
| ratio | Yes | ||
| version | Yes | ||
| background | No | ||
| foreground | No | ||
| ratioExact | No | ||
| effectiveBackground | No | ||
| effectiveForeground | No |