Skip to content
POST AI agent ready /v1/color/convert

Color Convert API - Free HEX RGB HSL Converter

Send a color in any supported format (HEX, RGB, or HSL) and receive all three representations back. Accepts hex strings with or without the # prefix.

Parameters

stringrequired

The color value to convert (HEX, RGB, or HSL).

Code examples

curl -X POST https://api.botoi.com/v1/color/convert \
  -H "Content-Type: application/json" \
  -d '{"color":"#3EC997"}'

When to use this API

Design token generation

Convert brand colors into all required formats for CSS custom properties (HSL), JavaScript constants (HEX), and native mobile code (RGB).

Accessibility contrast calculations

Convert colors to RGB to compute relative luminance and WCAG contrast ratios for accessibility compliance checks.

Frequently asked questions

Can I input an RGB string like rgb(62, 201, 151)?
Yes. The API accepts HEX strings (#3EC997), CSS RGB strings (rgb(62, 201, 151)), and HSL strings (hsl(158, 56%, 52%)).
Does the API support alpha/transparency?
Currently, the API handles opaque colors. RGBA and HSLA support is not available.
Is the HEX output uppercase or lowercase?
The HEX value is returned in uppercase (e.g., #3EC997).
Can I convert named CSS colors like "coral"?
No. Pass the explicit HEX, RGB, or HSL value. Use a CSS color name reference to find the corresponding hex code.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.