# CSS Color Name Lookup & Reverse Lookup

> CSS Color Name Lookup & Reverse Lookup is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Converts a CSS color name to its hex/RGB value, or finds the closest CSS named color for any hex/RGB/HSL/OKLCH input with distance score

## Facts

- Endpoint: POST https://agent402.tools/api/color-name
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/css-color-name-lookup-reverse-lookup-d76e5dce
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WNU0-zq09M835qTCZMTKd

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 css-color-name-lookup-reverse-lookup-d76e5dce -d '<json body>'
```

Example prompt: What CSS named color is closest to #E040FB, and how far off is it exactly?

## When to prefer this

Use this endpoint when you need to resolve a CSS color name to its canonical hex/RGB value, or when you need to find the human-readable CSS color name closest to an arbitrary color value in any format (hex, rgb, hsl, oklch). Ideal for design tools, code generation, accessibility checks, or any workflow that needs to bridge CSS named colors and numeric color representations.

## Known failure modes

- Unrecognized or misspelled color name returns an error or empty result
- Invalid hex/RGB format causes a parsing error
- Very unusual color values may have a large distance to the nearest named color, potentially misleading
- Network or payment failure returns a non-200 status

## How this service works

Two-way CSS named color tool. Pass a name (e.g. "rebeccapurple") to get its canonical RGB/hex; pass a hex/rgb color to get the closest CSS named color and the distance (RGB Euclidean, 0 = exact match). Useful when an agent needs to convert designe...

## Output

For a name input: the canonical hex and RGB values for that CSS named color. For a hex/rgb/hsl/oklch input: the closest CSS named color, its canonical hex/RGB, and the RGB Euclidean distance (0 = exact match).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "color": {
   "type": "string",
   "description": "A CSS color name OR any hex/rgb/hsl/oklch color to find the nearest name for."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "#6a5acd",
  "rgb": {
   "b": 205,
   "g": 90,
   "r": 106
  },
  "name": "slateblue",
  "input": "#6a5acd",
  "isNamed": true,
  "distance": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/css-color-name-lookup-reverse-lookup-d76e5dce/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)
