REST API v1

Developer API Documentation

High-performance color science API powering conversions, OKLCH scales, WCAG accessibility audits, and design token generators.

Authentication

Pass your secret API key in the Authorization header as a Bearer token or via X-API-Key.

Authorization: Bearer hl_live_xxxxxxxxxxxxxxxxxxxxxxxx
GET/v1/color/convert?color=%237357F6

Converts any valid hex color into HEX, RGB, HSL, HSV, CMYK, LAB, and OKLCH.

curl -X GET "https://api.huelab.online/v1/color/convert?color=%237357F6" \ -H "Authorization: Bearer hl_live_xxxx"
POST/v1/color/contrast-fix

Automatically calculates the smallest perceptual OKLCH adjustment to achieve WCAG AA (4.5:1) or AAA (7:1).

curl -X POST "https://api.huelab.online/v1/color/contrast-fix" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer hl_live_xxxx" \ -d '{"fg": "#777777", "bg": "#FFFFFF", "targetRatio": 4.5}'
POST/v1/color/design-system

Generates 50–950 color scales, semantic tokens, and light/dark theme combinations from a single base color.

curl -X POST "https://api.huelab.online/v1/color/design-system" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer hl_live_xxxx" \ -d '{"baseColor": "#7357F6"}'