# Color Contrast Ratio Checker

> Color Contrast Ratio Checker is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-23).

Calculates the WCAG contrast ratio between a foreground (text) color and background color, returning AA and AAA accessibility pass/fail results.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/color/contrast?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/color-contrast-ratio-checker-ad5518fb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8sD88InBXVFHqnTXGpG5G

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-contrast-ratio-checker-ad5518fb
```

Example prompt: Check the WCAG contrast ratio between text color #FFFFFF and background color #1A3C5E — does it pass AA and AAA accessibility standards for both normal and large text?

## When to prefer this

Choose this endpoint when you need a fast, no-account-required programmatic WCAG contrast ratio check paid per-call in USDC. Ideal for AI agents automating accessibility audits, design system validation pipelines, or one-off color pair checks without setting up a dedicated accessibility API key.

## Known failure modes

- Missing fg or bg query parameters returns an error
- Invalid or malformed color strings (non-hex, unsupported formats) may return an error or unexpected ratio
- Very similar colors return low ratios and all false flags
- Payment failure (402) if USDC balance insufficient — call is not charged on failure

## How this service works

WCAG 2 contrast ratio between a text colour and a background colour, with pass/fail for AA and AAA at normal and large text sizes. Use to check that a design is readable.

## Output

Returns a JSON object with the numeric contrast ratio (e.g. 4.54) and four boolean flags: aaLarge, aaNormal, aaaLarge, and aaaNormal — indicating whether the color pair passes WCAG 2.1 AA and AAA thresholds for large and normal text respectively.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "fg",
  "bg"
 ],
 "properties": {
  "bg": {
   "type": "string",
   "description": "Background colour"
  },
  "fg": {
   "type": "string",
   "description": "Text colour"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ratio": {
   "type": "number"
  },
  "aaLarge": {
   "type": "boolean"
  },
  "aaNormal": {
   "type": "boolean"
  },
  "aaaLarge": {
   "type": "boolean"
  },
  "aaaNormal": {
   "type": "boolean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/color-contrast-ratio-checker-ad5518fb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
