# x402.forgemesh.io Color Format Converter

> x402.forgemesh.io Color Format Converter 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).

Converts a hex or RGB color value into hex, RGB, and HSL representations, plus a light/dark classification and the optimal black-or-white text color for contrast.

## Facts

- Endpoint: POST https://x402.forgemesh.io/color-format-converter
- 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/x402-forgemesh-io-color-format-converter-f4524725
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VI03qDUVibcY_pk-5ahu1

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 x402-forgemesh-io-color-format-converter-f4524725 -d '<json body>'
```

Example prompt: What are the hex, RGB, and HSL values for #3a7bd5, and should I use black or white text on top of it for readability?

## When to prefer this

Use this endpoint when you need instant, exact color math for a single color value — specifically when you need multiple format representations (hex, RGB, HSL) together with a light/dark classification and a contrast-safe text color recommendation. It is ideal for UI theming pipelines, dashboard generators, and design-token workflows where you need all color metadata in one call without implementing color math yourself.

## Known failure modes

- Invalid color string (not a valid #RRGGBB or rgb(r,g,b) format) returns a 400 or error response
- Missing color field in request body results in validation error
- Out-of-range RGB component values (e.g. rgb(300,0,0)) may cause parsing failure
- Short hex codes like #fff may not be accepted if only 6-digit format is supported

## How this service works

Color format converter for hex codes and rgb() values: get back hex, RGB, and HSL representations plus a light-or-dark classification and the ideal black-or-white text color for readability on top of it. Handy for UI theming, chart palettes, and dashboard generators that need instant, exact color math without guessing at contrast ratios.

## Output

Returns the input color expressed as a hex string, an RGB object with r/g/b integer components, an HSL object with hue/saturation/lightness values, a 'light' or 'dark' classification of the color, and a recommended text color of either black or white for maximum readability contrast against that background.

## 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/x402-forgemesh-io-color-format-converter-f4524725/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)
