utilpeek: WCAG contrast check between a foreground and a background color
check_wcag_contrastutilpeek: Check the WCAG contrast between a text color and a background color. Returns the WCAG 2.x contrast ratio of a foreground and a background CSS color, with AA / AAA pass or fail for normal text, large text and UI components (unrounded: #777 on white is 4.48:1 and fails AA). Input: foreground and background. An unparseable or out-of-range color is a 422 before any payment (not charged). A translucent color is composited over the background before the contrast is computed. Typically under 0.1 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. Docs: https://tanod.dev/learn/color-contrast-checker-api.html
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| background | Yes | The background color it sits on, in the same CSS color formats. | |
| foreground | Yes | The text or UI color, a CSS color: hex (#rgb, #rrggbb, #rrggbbaa), rgb() / rgba(), hsl() / hsla() or a CSS color name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| ratio | No | ||
| background | No | ||
| composited | No | ||
| foreground | No | ||
| large_text | No | ||
| ratio_text | No | ||
| normal_text | No | ||
| ui_components | No | ||
| ratio_unrounded | No |