utilpeek: convert a color and check WCAG contrast
convert_color_check_contrastConvert a CSS color between hex, RGB, HSL and OKLCH, and check its WCAG contrast against an optional background for AA/AAA pass or fail.
Instructions
utilpeek: Convert a color between hex, RGB, HSL and OKLCH and check WCAG contrast. For contrast alone use check_wcag_contrast. Returns a CSS color (hex, rgb(), hsl() or a CSS name) as hex, rgb, hsl, hsv, naive cmyk, OKLCH and WCAG relative luminance; with a background, the WCAG 2.x contrast ratio and AA / AAA pass or fail for normal and large text and UI components (unrounded: #777 on white is 4.48:1 and fails AA). 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 |
|---|---|---|---|
| color | Yes | A CSS color: hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb() / rgba(), hsl() / hsla() or a CSS color name (148 names, plus transparent). | |
| background | No | Optional second color (e.g. the background): adds the WCAG 2.x contrast ratio and AA / AAA pass / fail. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| contrast | No | ||
| background | No |