Colour Converter API
Convert a colour between HEX, RGB(A), HSL and HSV, detecting the input format.
POST /api/v1/tools/color-converterMCP color_converterDesign & ColourConvert colours between HEX, RGB(A), HSL(A) and HSV instantly, with a live swatch. Supports 3, 4, 6 and 8-digit hex codes and alpha transparency.
Input
Send these as a JSON object. Unknown fields are rejected.
- color
- The colour: #f80, #ff8800, #ff880080, rgb(255, 136, 0), rgba(…), hsl(32, 100%, 50%) or hsv(32, 100%, 100%). (string, up to 100 characters, required)
curl https://pithlab.com/api/v1/tools/color-converter \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"color":"#0f766e"}'Example response
{
"ok": true,
"result": {
"detected": "hex",
"hex": "#0f766e",
"rgb": "rgb(15, 118, 110)",
"hsl": "hsl(175, 77%, 26%)",
"hsv": "hsv(175, 87%, 46%)",
"channels": {
"r": 15,
"g": 118,
"b": 110,
"a": 1
}
}
}