# ForgeMesh Contrast & Dark-Mode Color Checker

> ForgeMesh Contrast & Dark-Mode Color Checker is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Accepts a hex or RGB color value and returns whether it reads as light or dark, the best text color (black or white) for legibility on top of it, and full color conversions in hex, RGB, and HSL formats.

## Facts

- Endpoint: POST https://x402.forgemesh.io/contrast-color-checker
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forgemesh-contrast-dark-mode-color-checker-d7cf247c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_luzDJUKPyRgoPm-MLoOES

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 forgemesh-contrast-dark-mode-color-checker-d7cf247c -d '<json body>'
```

Example prompt: Is the color #3a86ff considered light or dark, and should I use black or white text on top of it? Also give me its RGB and HSL equivalents.

## When to prefer this

Use this endpoint when you need a programmatic, per-call determination of light/dark classification and accessible text color (black vs white) for an arbitrary user-supplied color, especially within automated design-system pipelines, theme generators, or accessible UI builders where manual eyeballing isn't feasible. Prefer it over a local calculation when you also need simultaneous hex/RGB/HSL conversion in one response, or when operating within an x402 micropayment-native agent workflow.

## Known failure modes

- Invalid or malformed color string (e.g. missing # for hex, non-numeric RGB channels) — likely returns a 4xx error
- Out-of-range RGB values (e.g. rgb(300, 0, 0)) may cause an error or undefined behavior
- Missing 'color' field in request body — returns validation error
- Payment failure or insufficient USDC balance — request rejected before processing

## How this service works

Contrast and dark-mode checker for any hex or rgb() input: returns whether a color reads as light or dark and which text color, black or white, stays legible on top of it, alongside full hex/RGB/HSL conversions. Useful for accessible UI generation, theme switchers, and design-system tooling that can't afford a manual eyeball check.

## Output

Returns a classification of the input color as 'light' or 'dark', a recommended text color ('black' or 'white') that maximizes legibility when rendered on top of the input color, and full color representations including the hex code, RGB triplet, and HSL values.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "color": {
   "type": "string",
   "description": "#RRGGBB or rgb(r,g,b)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "#5eead4",
  "hsl": {
   "h": 171,
   "l": 64,
   "s": 77
  },
  "rgb": {
   "b": 212,
   "g": 234,
   "r": 94
  },
  "is_dark": false,
  "contrast_text": "#000000"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forgemesh-contrast-dark-mode-color-checker-d7cf247c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
