Docs/APIs/Color Palette Generator

Color Palette Generator

Generate color palettes

OperationalCredits 1 per callp50 819msData GenerationStar

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.

GEThttps://api.apiverve.com/v1/colorpalette
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.

401 is the only auth verdict

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.

ParameterTypeDescription
colorRequiredstringThe base color to generate the palette from (HEX format without #)
hexColor
schemeOptionalstringThe color scheme type
monocontrasttriadetetradeanalogic
default triade
variationOptionalstringThe color variation
defaultsoftpastellighthardpale
default default
countOptionalPremiumintegerNumber of colors to return (1-16). Free tier limited to 5 colors
default 5 · range 1–16
distanceOptionalPremiumnumberColor spacing distance (0-1). Affects triade, tetrade, and analogic schemes
default 0.5 · range 0–1
addComplementOptionalPremiumbooleanAdd complement color to analogic scheme
webSafeOptionalbooleanReturn 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.

Sample response
{
  "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.

FieldTypeExampleDescription
sourcestring"#FF5733"
sourceNamestring"Outrageous Orange"
huenumber11
schemestring"triade"
variationstring"soft"
distancenumber0.5
colorCountnumber5
colorPalettearray[5]
hexstring"#CC988F"HEX values for each color in palette
namestring"Oriental Pink"
rgbobject{...}RGB values for each color
rnumber204
gnumber152
bnumber143
hslPremiumobject{...}HSL values for each color
hPremiumnumber9
sPremiumnumber37
lPremiumnumber68
luminancePremiumnumber0.373Luminance value for each color
isDarkbooleantrue
textColorstring"#FFFFFF"
accessibilityPremiumobject{...}WCAG contrast ratios and compliance
contrastWithWhitePremiumnumber2.48
contrastWithBlackPremiumnumber8.46
wcagAANormalPremiumbooleanfalse
wcagAALargePremiumbooleanfalse
wcagAAAPremiumbooleanfalse
colorPaletteRawarray[cc988f, ...]
cssPremiumstring":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
imagePremiumobject{...}Generated palette image file details
imageNamePremiumstring"6ee29826-a52f-4c87-86f5-bef3b49f0dbb_palette.png"Filename of the generated palette image
formatPremiumstring".png"Image file format (e.g. .png)
downloadURLPremiumstring"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
expiresPremiumnumber1766010083748

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.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead 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.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKitReference →
Use it in Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheetsReference →

More in Data Generation:

Was this page helpful?