convert_color_check_contrast
Convert CSS colors between hex, RGB, HSL, and OKLCH, and check WCAG contrast against a background to see AA/AAA pass or fail for text and UI components.
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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"color": "<color>"
},
"name": "convert_color_check_contrast"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | Yes | A CSS color: hex (#rgb, #rgba, #rrggbb, #rrggbbaa), rgb() / rgba(), hsl() / hsla(), oklch(), oklab(), lab(), lch(), color(srgb|display-p3|rec2020) or a CSS color name (148 names, plus transparent). | |
| background | No | 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 |