# Hex to HSL Color Converter

> Hex to HSL Color Converter is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-13).

Converts a hex color code to HSL (Hue, Saturation, Lightness) values, returning the RGB intermediate representation and a CSS hsl() string.

## Facts

- Endpoint: GET https://api.x402node.dev/color/hex-to-hsl
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-b9899460
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AjCU8_94IZJDPfSQaY66a

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 api-x402node-dev-b9899460
```

Example prompt: What's the HSL value of the hex color #3a86ff? I need both the CSS hsl() string and the intermediate RGB values.

## When to prefer this

Use this endpoint when you need to convert a hex color code to HSL format, especially when generating CSS stylesheets, performing color theory analysis, or needing the CSS hsl() string directly. Prefer this over manual computation when you want both the numeric HSL components and the formatted CSS value in one call.

## Known failure modes

- Invalid hex code format returns an error
- Missing or malformed input body returns a 400-level error
- Hex code with unsupported characters or wrong length fails validation

## How this service works

Hex to HSL converter, hue saturation lightness, HSL color picker, hex to hsl, RGB to HSL, color space conversion, CSS hsl(), color theory. Convert hex color into HSL (Hue, Saturation, Lightness) and return both RGB intermediate and CSS hsl() string. Accepts payment on Base or Solana — either network works.

## Output

Returns the hue (0-360), saturation (0-100%), and lightness (0-100%) values derived from the input hex color, along with the intermediate RGB components and a ready-to-use CSS hsl() string.

## 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",
     "required": [
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "description": "Hex color e.g. #3366cc (required)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-b9899460/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
