Home / APIs / Color Toolkit

Color Toolkit API

Convert colors (hex/RGB/HSL/HSV/CMYK), check WCAG contrast, and generate palettes — pure & fast.

Coming soon on RapidAPI ↗

Color Toolkit is a pure-math color API — no keys, no data sources, instant responses. Parse any hex, rgb(), hsl(), or CSS named color and get it back in every format (hex, RGB, HSL, HSV, CMYK).

It also computes WCAG 2.x contrast ratios with AA/AAA pass-fail (great for accessibility), and generates complementary, analogous, triadic, tetradic, and monochromatic palettes. Perfect for design tools, theme builders, accessibility checkers, and data-viz.

Endpoints

MethodPathDescription
GET/color/convert?color=hex / RGB / HSL / HSV / CMYK
GET/color/contrast?foreground=&background=WCAG 2.x ratio + AA/AAA
GET/color/palette?color=&type=complementary / analogous / triadic / tetradic / mono
GET/color/random?count=random colors

Quick start

cURL (via RapidAPI)
curl --url 'https://color-toolkit.p.rapidapi.com/contrast?foreground=%23777777&background=%23ffffff' \
  --header 'X-RapidAPI-Key: YOUR_KEY' \
  --header 'X-RapidAPI-Host: color-toolkit.p.rapidapi.com'
JavaScript (fetch)
const res = await fetch('https://color-toolkit.p.rapidapi.com/contrast?foreground=%23777777&background=%23ffffff', {
  headers: {
    'X-RapidAPI-Key': 'YOUR_KEY',
    'X-RapidAPI-Host': 'color-toolkit.p.rapidapi.com'
  }
});
const data = await res.json();
Example response
{
  "foreground": "#777777",
  "background": "#ffffff",
  "ratio": 4.48,
  "aa": {
    "normalText": false,
    "largeText": true
  },
  "aaa": {
    "normalText": false,
    "largeText": false
  }
}

Pricing

Subscribe on RapidAPI. Start free; upgrade as you scale.

Basic
Free
1,000 requests / mo
Pro
$5 / mo
100,000 requests / mo
Ultra
$20 / mo
1,000,000 requests / mo
Mega
$50 / mo
2,000,000 requests / mo

Frequently asked questions

What color formats are supported?

Input: hex (#fff or #ffffff), rgb()/rgba(), hsl()/hsla(), and CSS named colors. Output: hex, RGB, HSL, HSV, and CMYK.

Does the contrast check follow WCAG?

Yes — it uses the WCAG 2.x relative-luminance formula and reports AA/AAA pass-fail for normal and large text.

What palette types are available?

Complementary, analogous, triadic, tetradic, and monochromatic (with a configurable number of steps).

Ready to build with Color Toolkit?

Grab your key on RapidAPI and start on the free tier.

Coming soon on RapidAPI ↗