No API key. No signup. CORS open. 60 requests per minute. Use it from a static site, a browser extension, a Figma plugin, or your CI.
Sub-50ms responses, globally distributed.
Call directly from the browser. No proxy needed.
IPs are used only for rate limiting and immediately forgotten.
Machine-readable spec at /api/v1/openapi.json - import to Postman, generate SDKs.
/api/v1/convertConvert any CSS color into every supported format (HEX, RGB, HSL, LCH, OKLCH, LAB).
color*stringAny CSS-recognised color (HEX, rgb(), hsl(), oklch(), or a named color).formatstringall | hex | rgb | hsl | lch | oklch | lab. Defaults to "all"./api/v1/convert?color=%237c5cff&format=oklchTry it {
"input": "#7c5cff",
"oklch": { "l": 0.5901, "c": 0.2376, "h": 282.47 },
"css": "oklch(59.01% 0.2376 282.47)"
}/api/v1/contrastCompute the WCAG 2.1 contrast ratio between two colors plus AA / AAA pass-fail flags.
fg*stringForeground color.bg*stringBackground color./api/v1/contrast?fg=%23ffffff&bg=%237c5cffTry it {
"fg": "#ffffff",
"bg": "#7c5cff",
"ratio": 4.78,
"wcag": {
"aa": { "normalText": true, "largeText": true, "graphics": true },
"aaa": { "normalText": false, "largeText": true }
},
"grade": "AA"
}/api/v1/paletteGenerate a palette from a free-text prompt (AI mode), a harmony rule, or randomly.
promptstringFree-text intent ("luxury watch brand"). Triggers AI mode.variantinteger0-99. Same prompt + variant always returns the same palette.harmonystringcomplementary | analogous | triadic | tetradic | split-complementary | square | monochromatic.basestringRequired when `harmony` is set.countinteger2-8 (random mode only). Defaults to 5./api/v1/palette?prompt=Cyberpunk%20gaming%20UITry it {
"source": "ai",
"prompt": "Cyberpunk gaming UI",
"colors": ["#0b0b1a", "#7c5cff", "#ff2bd6", "#06f5ff", "#fbbf24"],
"intent": { "key": "gaming", "label": "Gaming / Esports", "rationale": "..." },
"narratives": [/* per-color explanations */],
"shareUrl": "https://colorui.io/p/0b0b1a7c5cffff2bd606f5fffbbf24"
}60 requests per IP per 60 seconds. Every response includes:
X-RateLimit-Limit - your bucket size (always 60).X-RateLimit-Remaining - calls left in the current window.X-RateLimit-Reset - UNIX epoch (seconds) when the bucket refills.Need higher throughput? Get in touch - we can issue a key for batch use.
Endpoints live under /api/v1/*. Breaking changes will only ship under /api/v2/* - v1 will continue to work. New optional parameters or response fields may be added at any time.
const r = await fetch(
'https://colorui.io/api/v1/contrast?fg=%23ffffff&bg=%237c5cff'
);
const { ratio, grade } = await r.json();
console.log(ratio, grade); // 4.78 'AA'The full machine-readable spec is served at /api/v1/openapi.json. Import it into your tool of choice:
https://colorui.io/api/v1/openapi.jsonnpx @openapitools/openapi-generator-cli generate -i https://colorui.io/api/v1/openapi.json -g typescript-fetch -o ./colorui-sdkkiota generate -d https://colorui.io/api/v1/openapi.json -l typescript -o ./colorui-sdknpx openapi-zod-client https://colorui.io/api/v1/openapi.json -o colorui-client.tsSkip the SDK step and call the API straight from your favourite workbench. Each collection ships with the four endpoints, the right query encodings, and a `baseUrl` variable so you can point at a self-hosted deployment.
https://colorui.io/api/v1/postman.jsonopenapi/bruno/from the repo.openapi/colorui.insomnia_collection.jsonnpx newman run https://colorui.io/api/v1/postman.json