# agent402.tools Color Converter

> agent402.tools Color Converter is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Converts a color from any common notation (hex, RGB, HSL, OKLCH, or CSS named color) into all common formats simultaneously, including the nearest CSS named color.

## Facts

- Endpoint: POST https://agent402.tools/api/color-convert
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-color-converter-b685752f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZMYMPGa1qax_d735vE6nw

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 agent402-tools-color-converter-b685752f -d '<json body>'
```

Example prompt: Convert the color #3a7bd5 into every common format — hex, RGB, HSL, and OKLCH — and also tell me the nearest CSS named color.

## When to prefer this

Use this endpoint when you need to convert a color between multiple representations all at once, especially when you also need the nearest CSS named color. Ideal for frontend/design workflows where a single color needs to be expressed in hex, RGB, HSL, and OKLCH simultaneously without making multiple separate conversion calls.

## Known failure modes

- Invalid or unrecognized color string returns an error (e.g. malformed hex, unknown named color)
- Missing 'color' field in request body returns a validation error
- Ambiguous input that doesn't match any supported notation may be rejected

## How this service works

Convert a color between every common notation (hex, rgb, hsl, oklch) at once, plus return the nearest CSS named color. Accepts input as hex (#fff or #ffffff), rgb()/rgba(), hsl()/hsla(), oklch(), or any of the 148 CSS named colors. Use this when a...

## Output

Returns the input color expressed in all major color notations: hex, rgb(), hsl(), and oklch(), plus the name and value of the nearest CSS named color from the 148 standard named colors.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "color": {
   "type": "string",
   "description": "Color in any supported notation: hex, rgb(), hsl(), oklch(), or a CSS named color."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "#1d4ed8",
  "hsl": {
   "h": 224.04,
   "l": 48.04,
   "s": 76.42
  },
  "rgb": {
   "b": 216,
   "g": 78,
   "r": 29
  },
  "input": "#1d4ed8",
  "oklch": {
   "C": 0.217,
   "H": 264.39,
   "L": 0.488
  },
  "hslString": "hsl(224.04, 76.42%, 48.04%)",
  "rgbString": "rgb(29, 78, 216)",
  "oklchString": "oklch(0.488 0.217 264.39)",
  "nearestNamed": {
   "name": "royalblue",
   "distance": 51
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-color-converter-b685752f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
