Which color formats can I send?
Hex values, CSS functions, named colors, and structured channel objects. color, input, hex, and value are accepted aliases.
Convert hex, named CSS, and functional colors into RGB, HSL, OKLab, contrast scores, and harmony palettes in one call.
This calls the live Color Convert API. Type a color, pick a swatch, and preview hex, rgb, hsl, and contrast.
Converting color...
Why Color Convert API
Every common color space
Hex, RGB, HSL, HSV, CMYK, XYZ, LAB, OKLab, and OKLCH from one color input.
WCAG and APCA contrast
Ratings against white and black, a recommended text color, and optional contrast_with pairs.
Color-vision simulations
Simulation matrices for common deficiencies so UI tokens can be checked before they ship.
Harmony palettes
Complementary, analogous, triadic, tetradic, split-complementary, plus tints and shades.
CSS gradients
Linear and radial gradient strings with a configurable gradient_angle for design-system output.
Nearest named color
Map any input to the closest CSS named color for documentation and token catalogs.
/api/v1/color-convert
Convert a color
Query color (or hex / input / value) plus optional contrast_with and gradient_angle.
Convert via JSON
Same conversion with a structured color object or CSS string in the body.
| Parameter | Type | Required | Description |
|---|---|---|---|
| color | string | yes* | Hex, named CSS, or functional color. Aliases: input, hex, value. |
| contrast_with | string | no | Second color for a custom WCAG contrast pair. |
| gradient_angle | number | no | Linear gradient angle in degrees. Defaults to 90. |
Error reference
Missing or invalid color input.
Missing or invalid gateway API key. Send x-api-key or api_key with every request.
Unknown route under /api/v1/color-convert.
JSON body exceeds 16 KB.
More than 120 requests in a 15-minute window.
Example error response
{
"success": false,
"error": { "code": "VALIDATION_ERROR", "message": "Invalid color" },
"correlationId": "1784849006651-color01"
}FAQ
Hex values, CSS functions, named colors, and structured channel objects. color, input, hex, and value are accepted aliases.
Yes. Every conversion includes WCAG ratings against white and black, a recommended text color, and supplementary APCA scores. Pass contrast_with for a custom pair.
The response includes complementary, analogous, triadic, tetradic, split-complementary, monochromatic, tints, shades, plus linear and radial CSS gradients.
No. Color Convert is a numeric CSS utility. It does not accept images, store palettes, or manage ICC profiles.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
Hex, named CSS, rgb, and hsl in. Hex, rgb, hsl, and contrast ratios out.