Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Convert colors between HEX, RGB, and HSL formats instantly. Submit a color in any of the three supported formats and receive the equivalent values in all three, eliminating manual conversion math in design tools, theming systems, and CSS generators.Use cases
- Convert brand colors between formats for cross-platform design systems
- Generate CSS custom properties in all formats from a single source
- Validate color inputs in design or configuration UIs
- Transform palette exports from design tools into developer-friendly formats
Details
HEX values should include the# prefix (e.g. #ff5733). RGB components are integers 0–255. HSL hue is 0–360 degrees; saturation and lightness are percentages 0–100.
Request body
Provide exactly one ofhex, rgb, or hsl.
| Field | Type | Required | Description |
|---|---|---|---|
hex | string | No | Hex color string (e.g. #ff5733) |
rgb | object | No | RGB object with r, g, b integer fields (0–255) |
hsl | object | No | HSL object with h (0–360), s (0–100), l (0–100) fields |
Example — from HEX
Example — from RGB
Example — from HSL
Response
200 OK
| Field | Type | Description |
|---|---|---|
hex | string | HEX representation (uppercase, e.g. #FF5733) |
rgb | object | RGB object with integer fields r, g, b (0–255) |
hsl | object | HSL object with integer fields h (0–360), s (0–100), l (0–100) |
cmyk | object | CMYK object with integer fields c, m, y, k (0–100) |
css | object | Ready-to-use CSS strings: hex (string), rgb (e.g. "rgb(255, 87, 51)"), hsl (e.g. "hsl(11, 100%, 60%)") |

