About this endpoint
What it does
Converts a color into HEX, RGB, HSL, HSV, and CMYK formats. The response also includes accessibility details such as the recommended text color and generated color palettes.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| color | String | Yes | A color as hex (#rrggbb), rgb(), or hsl() |
Response
Returns a JSON object containing the converted color in multiple formats, accessibility information, and generated color palettes.
| Field | Type | Description |
|---|---|---|
| input | String | The original color value provided in the request. |
| hex | String | Color in HEX format. |
| rgb | Object | Color represented as RGB values (r, g, b). |
| rgb_string | String | Color formatted as an rgb() CSS string. |
| hsl | Object | Color represented as HSL values (h, s, l). |
| hsv | Object | Color represented as HSV values (h, s, v). |
| cmyk | Object | Color represented as CMYK values (c, m, y, k). |
| luminance | Number | Relative luminance of the color. |
| readable_text_color | String | Recommended text color (black or white) for better readability. |
| palette | Object | Generated complementary, analogous, and triadic color palette. |