# 402utils Color Utilities

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

Converts colors between formats, computes WCAG accessibility contrast ratios, and derives color palettes from a given color

## Facts

- Endpoint: GET https://402utils.com/v1/color
- 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/402utils-color-utilities-05861f97
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_i9qnVA0-MKC2wJaWBsNx8

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 402utils-color-utilities-05861f97
```

Example prompt: Check if my text color #1a1a2e on background #f0f0f0 passes WCAG 2.x AA and AAA accessibility standards for both normal and large text, and also tell me the contrast ratio.

## When to prefer this

Use this endpoint when you need color format conversion, WCAG accessibility contrast checking (AA/AAA compliance), or palette generation in a single lightweight paid API call. Prefer it over client-side libraries when you need a backend or agent-accessible computation, or when you want authoritative WCAG 2.x pass/fail verdicts including UI component thresholds. Well-suited for design tools, accessibility auditing, and automated UI checks.

## Known failure modes

- Invalid or unrecognized color format returns an error
- Missing required color parameter returns an error
- Missing fg or bg when op=contrast returns an error
- Malformed hex string (e.g. including '#') may fail — hex must be sent without '#'
- Unsupported op value returns an error

## How this service works

Colour utilities: ?op=convert (default) turns any hex/rgb()/hsl()/CSS-name into hex, rgb, hsl, hsv, alpha, relative luminance and exact CSS name; ?op=contrast with ?fg=&bg= returns the WCAG 2.x contrast ratio and AA/AAA pass/fail for normal & large text plus UI components (accessibility / EAA); ?op=palette derives complementary, analogous, triadic, tints and shades. Send hex without '#'.

## Output

Depending on the operation: (convert) hex, rgb, hsl, hsv, alpha, relative luminance (0-1), and exact CSS name if one exists; (contrast) WCAG contrast ratio (1-21), and AA/AAA pass/fail booleans for normal text, large text, and UI components; (palette) hex strings for complementary, analogous, triadic colors, plus arrays of tints and shades.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "bg": {
       "type": "string",
       "description": "Background colour (op=contrast). Falls back to `color` for fg."
      },
      "fg": {
       "type": "string",
       "description": "Foreground colour (op=contrast)."
      },
      "op": {
       "enum": [
        "convert",
        "contrast",
        "palette"
       ],
       "type": "string",
       "default": "convert"
      },
      "color": {
       "type": "string",
       "description": "The colour (convert/palette): hex without '#', rgb(), hsl() or a CSS name."
      }
     },
     "description": "Query string only."
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "op"
     ],
     "properties": {
      "AA": {
       "type": "object",
       "description": "AA pass/fail for normalText, largeText, uiComponents."
      },
      "op": {
       "type": "string"
      },
      "AAA": {
       "type": "object",
       "description": "AAA pass/fail for normalText, largeText."
      },
      "hex": {
       "type": "string"
      },
      "hsl": {
       "type": "object"
      },
      "hsv": {
       "type": "object"
      },
      "rgb": {
       "type": "object"
      },
      "name": {
       "type": [
        "string",
        "null"
       ],
       "description": "Exact CSS colour name, if any."
      },
      "ratio": {
       "type": "number",
       "description": "WCAG contrast ratio 1-21 (op=contrast)."
      },
      "tints": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "shades": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "triadic": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "analogous": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "luminance": {
       "type":
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-color-utilities-05861f97/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
