Overview
Color Palette works by generating color palettes based on color theory principles. It returns harmonious colors with multiple format outputs (HEX, RGB, HSL), accessibility metrics, ready-to-use CSS variables, and downloadable palette images.
Endpoint
One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.
curl "https://api.apiverve.com/v1/colorpalette?color=FF5733&scheme=triade&variation=soft&count=5&distance=0.5&addComplement=true&webSafe=false" \
-H "x-api-key: your_api_key_here"const res = await fetch('https://api.apiverve.com/v1/colorpalette?color=FF5733&scheme=triade&variation=soft&count=5&distance=0.5&addComplement=true&webSafe=false', {
headers: { 'x-api-key': 'your_api_key_here' },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const { data } = await res.json();
console.log(data);import requests
res = requests.get(
"https://api.apiverve.com/v1/colorpalette?color=FF5733&scheme=triade&variation=soft&count=5&distance=0.5&addComplement=true&webSafe=false",
headers={"x-api-key": "your_api_key_here"},
timeout=15,
)
res.raise_for_status()
print(res.json()["data"])package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/colorpalette?color=FF5733&scheme=triade&variation=soft&count=5&distance=0.5&addComplement=true&webSafe=false", nil)
req.Header.Set("x-api-key", "your_api_key_here")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.
Authentication
Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Parameters
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.
| Parameter | Type | Description |
|---|---|---|
colorRequired | string | The base color to generate the palette from (HEX format without #) hexColor |
schemeOptional | string | The color scheme typemonocontrasttriadetetradeanalogicdefault triade |
variationOptional | string | The color variationdefaultsoftpastellighthardpaledefault default |
countOptionalPremium | integer | Number of colors to return (1-16). Free tier limited to 5 colors default 5 · range 1–16 |
distanceOptionalPremium | number | Color spacing distance (0-1). Affects triade, tetrade, and analogic schemes default 0.5 · range 0–1 |
addComplementOptionalPremium | boolean | Add complement color to analogic scheme |
webSafeOptional | boolean | Return web-safe colors only |
Response
Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.
{
"status": "ok",
"error": null,
"data": {
"source": "#FF5733",
"sourceName": "Outrageous Orange",
"hue": 11,
"scheme": "triade",
"variation": "soft",
"distance": 0.5,
"colorCount": 5,
"colorPalette": [
{
"hex": "#CC988F",
"name": "Oriental Pink",
"rgb": {
"r": 204,
"g": 152,
"b": 143
},
"hsl": {
"h": 9,
"s": 37,
"l": 68
},
"luminance": 0.373,
"isDark": true,
"textColor": "#FFFFFF",
"accessibility": {
"contrastWithWhite": 2.48,
"contrastWithBlack": 8.46,
"wcagAANormal": false,
"wcagAALarge": false,
"wcagAAA": false
}
},
{
"hex": "#805F59",
"name": "Russett",
"rgb": {
"r": 128,
"g": 95,
"b": 89
},
"hsl": {
"h": 9,
"s": 18,
"l": 43
},
"luminance": 0.135,
"isDark": true,
"textColor": "#FFFFFF",
"accessibility": {
"contrastWithWhite": 5.68,
"contrastWithBlack": 3.7,
"wcagAANormal": true,
"wcagAALarge": true,
"wcagAAA": false
}
},
{
"hex": "#E6D2CF",
"name": "Dust Storm",
"rgb": {
"r": 230,
"g": 210,
"b": 207
},
"hsl": {
"h": 8,
"s": 32,
"l": 86
},
"luminance": 0.674,
"isDark": false,
"textColor": "#000000",
"accessibility": {
"contrastWithWhite": 1.45,
"contrastWithBlack": 14.48,
"wcagAANormal": true,
"wcagAALarge": true,
"wcagAAA": true
}
},
{
"hex": "#BF6E60",
"name": "Contessa",
"rgb": {
"r": 191,
"g": 110,
"b": 96
},
"hsl": {
"h": 9,
"s": 43,
"l": 56
},
"luminance": 0.231,
"isDark": true,
"textColor": "#FFFFFF",
"accessibility": {
"contrastWithWhite": 3.74,
"contrastWithBlack": 5.61,
"wcagAANormal": false,
"wcagAALarge": true,
"wcagAAA": false
}
},
{
"hex": "#A2CC8F",
"name": "Pine Glade",
"rgb": {
"r": 162,
"g": 204,
"b": 143
},
"hsl": {
"h": 101,
"s": 37,
"l": 68
},
"luminance": 0.529,
"isDark": false,
"textColor": "#000000",
"accessibility": {
"contrastWithWhite": 1.82,
"contrastWithBlack": 11.57,
"wcagAANormal": true,
"wcagAALarge": true,
"wcagAAA": true
}
}
],
"colorPaletteRaw": [
"cc988f",
"805f59",
"e6d2cf",
"bf6e60",
"a2cc8f"
],
"css": ":root {\n --primary: #CC988F;\n --primary-rgb: 204, 152, 143;\n --secondary: #805F59;\n --secondary-rgb: 128, 95, 89;\n --tertiary: #E6D2CF;\n --tertiary-rgb: 230, 210, 207;\n --quaternary: #BF6E60;\n --quaternary-rgb: 191, 110, 96;\n --quinary: #A2CC8F;\n --quinary-rgb: 162, 204, 143;\n}",
"image": {
"imageName": "6ee29826-a52f-4c87-86f5-bef3b49f0dbb_palette.png",
"format": ".png",
"downloadURL": "https://storage.googleapis.com/apiverve/APIData/colorpalette/6ee29826-a52f-4c87-86f5-bef3b49f0dbb_palette.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010083&Signature=Boef5OapaNmcyp0F8bGmf%2BVfQk3zQkiWcw1THBfbsevtYGZnOuzr7xKDRlk9FYiHidSoMz6wjody2ymL7GzUoHkDvA8PEdSERhAq2z9St5yWlaX1c87KoNh%2FtCQEJqHixYk039NuYyb%2FhJu18JFY1RNrOfo8OPZEn9a3ICQdTDL0fYQEZEBxnDuc%2B7wvn4q9UFWhCJcf302HcoZoCw76AzrgVRu%2FazuahqHdVWMR1K5QTV3U51lSoqC23ERHjRZ6uZB8W0bCO65qBFrRNzWEPSVCC%2F8oafvvitZwB1YCG674q3MbtRhWXIhX2zdoPCT%2BgxL7E4fgIyXDtDLm5%2Bm%2Fsg%3D%3D",
"expires": 1766010083748
}
}
}Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
source | string | "#FF5733" | |
sourceName | string | "Outrageous Orange" | |
hue | number | 11 | |
scheme | string | "triade" | |
variation | string | "soft" | |
distance | number | 0.5 | |
colorCount | number | 5 | |
colorPalette | array[5] | ||
hex | string | "#CC988F" | HEX values for each color in palette |
name | string | "Oriental Pink" | |
rgb | object | {...} | RGB values for each color |
r | number | 204 | |
g | number | 152 | |
b | number | 143 | |
hslPremium | object | {...} | HSL values for each color |
hPremium | number | 9 | |
sPremium | number | 37 | |
lPremium | number | 68 | |
luminancePremium | number | 0.373 | Luminance value for each color |
isDark | boolean | true | |
textColor | string | "#FFFFFF" | |
accessibilityPremium | object | {...} | WCAG contrast ratios and compliance |
contrastWithWhitePremium | number | 2.48 | |
contrastWithBlackPremium | number | 8.46 | |
wcagAANormalPremium | boolean | false | |
wcagAALargePremium | boolean | false | |
wcagAAAPremium | boolean | false | |
colorPaletteRaw | array | [cc988f, ...] | |
cssPremium | string | ":root {
--primary: #CC988F;
--primary-rgb: 204, 152, 143;
--secondary: #805F59;
--secondary-rgb: 128, 95, 89;
--tertiary: #E6D2CF;
--tertiary-rgb: 230, 210, 207;
--quaternary: #BF6E60;
--quaternary-rgb: 191, 110, 96;
--quinary: #A2CC8F;
--quinary-rgb: 162, 204, 143;
}" | Ready-to-use CSS variables |
imagePremium | object | {...} | Generated palette image file details |
imageNamePremium | string | "6ee29826-a52f-4c87-86f5-bef3b49f0dbb_palette.png" | Filename of the generated palette image |
formatPremium | string | ".png" | Image file format (e.g. .png) |
downloadURLPremium | string | "https://storage.googleapis.com/apiverve/APIData/colorpalette/6ee29826-a52f-4c87-86f5-bef3b49f0dbb_palette.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010083&Signature=Boef5OapaNmcyp0F8bGmf%2BVfQk3zQkiWcw1THBfbsevtYGZnOuzr7xKDRlk9FYiHidSoMz6wjody2ymL7GzUoHkDvA8PEdSERhAq2z9St5yWlaX1c87KoNh%2FtCQEJqHixYk039NuYyb%2FhJu18JFY1RNrOfo8OPZEn9a3ICQdTDL0fYQEZEBxnDuc%2B7wvn4q9UFWhCJcf302HcoZoCw76AzrgVRu%2FazuahqHdVWMR1K5QTV3U51lSoqC23ERHjRZ6uZB8W0bCO65qBFrRNzWEPSVCC%2F8oafvvitZwB1YCG674q3MbtRhWXIhX2zdoPCT%2BgxL7E4fgIyXDtDLm5%2Bm%2Fsg%3D%3D" | URL to download the generated palette image |
expiresPremium | number | 1766010083748 |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted | A key restriction or IP allow-list; see key scoping. |
429 | Rate limited, or out of credits | Read error to tell them apart; see rate limits. |
Use cases
- Graphic Design
- Use the Color Palette API to generate color palettes for graphic design projects. Use the data to create visually appealing designs, logos, and illustrations
- Web Development
- Develop websites by using the Color Palette API to generate color palettes. Get ready-to-use CSS variables and ensure WCAG accessibility compliance
- UI/UX Design
- Design user interfaces by using the Color Palette API to generate color palettes. Use accessibility data to ensure text readability and contrast compliance
- Brand Identity
- Create cohesive brand color systems with harmonious palettes. Export as CSS variables for consistent implementation across platforms
Other ways to use Color Palette Generator
Set up Color Palette Generator on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.
Related
More in Data Generation: