# Color Toolkit – Contrast Ratio Calculator

> Color Toolkit – Contrast Ratio Calculator is a paid API for AI agents from color.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Computes the contrast ratio between a foreground (text) color and a background color to assess accessibility compliance

## Facts

- Endpoint: POST https://color.openverbs.com/v1/contrast
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/color-toolkit-contrast-ratio-calculator-08ce3735
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hKRHlW-Dr9JLx_UR4Fduu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability color-toolkit-contrast-ratio-calculator-08ce3735 -d '<json body>'
```

Example prompt: Can you check the contrast ratio between the text color #FFFFFF and the background color #1A237E to see if it passes accessibility standards?

## When to prefer this

Choose this endpoint when you need a fast, programmatic contrast ratio calculation between exactly two colors — foreground and background — especially for WCAG accessibility compliance checks in UI/UX workflows, design audits, or automated accessibility testing pipelines. Prefer it over manual tools when integrating color accessibility validation into an agent-driven design or code review workflow.

## Known failure modes

- Invalid or unrecognized color format for foreground or background (e.g. malformed hex, unsupported color name) returns an error
- Missing required fields (foreground or background) returns a validation error
- Extreme edge cases like transparent or undefined colors may return an error

## How this service works

Compute the WCAG 2.1 contrast ratio between two colors and whether it passes AA/AAA.

## Output

Returns the computed contrast ratio between the two specified colors (foreground and background), typically as a numeric ratio (e.g. 4.5:1), along with an indication of whether the pair passes WCAG AA or AAA accessibility thresholds for normal and large text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "foreground",
      "background"
     ],
     "properties": {
      "background": {
       "type": "string",
       "maxLength": 128,
       "minLength": 1,
       "description": "Background color."
      },
      "foreground": {
       "type": "string",
       "maxLength": 128,
       "minLength": 1,
       "description": "Text/foreground color."
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/color-toolkit-contrast-ratio-calculator-08ce3735/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from color.openverbs.com](https://www.zero.xyz/host/color.openverbs.com/llms.txt)
