About this endpoint
What it does
Converts a HEX color provided as a query parameter into its RGB and HSL equivalents. The response returns the original hex value along with hsl and rgb objects.
Query Parameter(s)
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| hex | String | Yes | The HEX color value to convert. |
Response
Returns a JSON object with hex as a string, hsl as an object containing h, s, and l numbers, and rgb as an object containing r, g, and b integers.
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| hex | String | No | The original HEX color value. |
| hsl | Object | No | The HSL representation of the color. |
| hsl.h | Number | No | Hue value. |
| hsl.s | Number | No | Saturation value. |
| hsl.l | Number | No | Lightness value. |
| rgb | Object | No | The RGB representation of the color. |
| rgb.r | Integer | No | Red channel value. |
| rgb.g | Integer | No | Green channel value. |
| rgb.b | Integer | No | Blue channel value. |