# Swift Bot Labs Color Utility

> Swift Bot Labs Color Utility is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Parses a CSS/hex/named color string and returns its hex, RGB, and HSL representations plus optional WCAG contrast ratio against a second color.

## Facts

- Endpoint: GET https://x402-toolbox.swiftbotlab.workers.dev/v1/color?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-color-utility-44d43535
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xjmz_PQyBYpmLOBWWWUrn

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 swift-bot-labs-color-utility-44d43535
```

Example prompt: What are the hex, RGB, and HSL values for 'dodger blue', and does it pass WCAG AA contrast against white?

## When to prefer this

Use this endpoint when you need a fast, pay-per-call, no-account color parsing and conversion utility — especially if you also need WCAG accessibility contrast checking in the same call. Prefer it over local libraries when running in a serverless or agent context without a color parsing dependency available.

## Known failure modes

- Unrecognized color string returns an error or ok:false
- Missing required 'color' query parameter causes a 400-level error
- Invalid second color in 'against' param fails contrast computation
- Payment not provided or declined returns HTTP 402

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

A JSON object with ok:true, the tool name, and a result containing the parsed color in hex, RGB (r/g/b integers 0-255), HSL (h/s/l floats), and optionally a contrast block with the ratio, AA, AAA, and AALarge boolean flags per WCAG 2.1 guidelines.

## 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",
      "HEAD"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "color"
     ],
     "properties": {
      "color": {
       "type": "string"
      },
      "against": {
       "type": "string",
       "description": "Optional second colour for a contrast check"
      }
     },
     "additionalProperties": false
    },
    "discoverable": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "color",
  "result": {
   "hex": "#1e90ff",
   "hsl": {
    "h": 209.6,
    "l": 55.9,
    "s": 100
   },
   "rgb": {
    "b": 255,
    "g": 144,
    "r": 30
   },
   "contrast": {
    "AA": false,
    "AAA": false,
    "ratio": 3.24,
    "AALarge": true
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-color-utility-44d43535/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
