# Color Palette Generator API

> Color Palette Generator is a color palette API that builds a harmonious color scheme from one HEX base color. Every plan returns each color's HEX code, closest color name, a dark flag and a legible black or white text color; paid plans add RGB, HSL, WCAG contrast checks, CSS variables and a PNG of the palette.

**Endpoint:** `GET https://api.apiverve.com/v1/colorpalette`  
**Category:** Data Generation  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/colorpalette

## Overview

A color palette generator API for themes, design tools and white-label apps. Send a base color, a scheme (mono, contrast, triade, tetrade or analogic) and a variation (default, soft, pastel, light, hard or pale), and the generator places the other colors around the color wheel from the base color's hue by color theory rules, keeping the base color's saturation and lightness, optionally limited to web-safe colors. The Free plan returns up to 5 colors with HEX, name, isDark and textColor, plus a plain list of HEX values. Paid plans return up to 16 depending on the scheme and add RGB, HSL, WCAG luminance, contrast ratios against white and black with AA and AAA pass flags, ready-to-paste CSS variables and a downloadable palette image. To convert a single color between formats, use Color Converter.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
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"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `color` | string | Yes | The base color to generate the palette from (HEX format without #). hexColor |
| `scheme` | string | No | The color scheme type. default triade. One of: mono, contrast, triade, tetrade, analogic |
| `variation` | string | No | The color variation. default default. One of: default, soft, pastel, light, hard, pale |
| `count` | integer | No | Caps how many colors are returned (1-16). Each scheme has its own ceiling and count cannot raise it - mono yields 4, contrast 8, triade and analogic 12, tetrade 16. When capped, one shade of every hue is returned before a second shade of any, so a 5-color triade holds all 3 hues. The colorCount field reports how many were actually returned. Free tier limited to 5 colors. default 5. range 1-16. Premium field |
| `distance` | number | No | Color spacing distance (0-1). Affects triade, tetrade, and analogic schemes. default 0.5. range 0-1. Premium field |
| `addComplement` | boolean | No | Add complement color to analogic scheme. default false. Premium field |
| `webSafe` | boolean | No | Return web-safe colors only. default false |

## Response fields

- `source` — string · The normalized base color the palette was generated from, in HEX format with a leading #
- `sourceName` — string · The human-readable color name closest to the base color
- `hue` — number · The base color's position on the HSL color wheel, in degrees from 0 to 360
- `scheme` — string · The color scheme type that was used to generate the palette
- `variation` — string · The color variation that was applied to the palette
- `distance` — number · The color spacing distance that was applied when generating the palette
- `colorCount` — number · The number of colors included in the palette
  - `colorPalette.0.hex` — string · HEX values for each color in palette
  - `colorPalette.0.name` — string · The human-readable color name closest to this palette color
  - `colorPalette.0.rgb` — object · RGB values for each color · (premium)
    - `colorPalette.0.rgb.r` — number · (premium)
    - `colorPalette.0.rgb.g` — number · (premium)
    - `colorPalette.0.rgb.b` — number · (premium)
  - `colorPalette.0.hsl` — object · HSL values for each color · (premium)
    - `colorPalette.0.hsl.h` — number · (premium)
    - `colorPalette.0.hsl.s` — number · (premium)
    - `colorPalette.0.hsl.l` — number · (premium)
  - `colorPalette.0.luminance` — number · The relative luminance (WCAG) of the color, from 0 (black) to 1 (white) · (premium)
  - `colorPalette.0.isDark` — boolean · Whether white text is more legible on this color than black, by WCAG contrast ratio (relative luminance below about 0.18)
  - `colorPalette.0.textColor` — string · The recommended HEX text color (white or black) to overlay on this color for legibility
  - `colorPalette.0.accessibility` — object · WCAG contrast ratios and compliance · (premium)
    - `colorPalette.0.accessibility.contrastWithWhite` — number · (premium)
    - `colorPalette.0.accessibility.contrastWithBlack` — number · (premium)
    - `colorPalette.0.accessibility.wcagAANormal` — boolean · (premium)
    - `colorPalette.0.accessibility.wcagAALarge` — boolean · (premium)
    - `colorPalette.0.accessibility.wcagAAA` — boolean · (premium)
- `colorPaletteRaw` — array · The palette colors as plain lowercase HEX strings without the # prefix, in the same order as colorPalette
- `css` — string · Ready-to-use CSS variables · (premium)
- `image` — object · Generated palette image file details · (premium)
  - `image.imageName` — string · Filename of the generated palette image · (premium)
  - `image.format` — string · Image file format (e.g. .png) · (premium)
  - `image.downloadURL` — string · URL to download the generated palette image · (premium)
  - `image.expires` — number · Unix timestamp in milliseconds when the generated palette image download URL expires · (premium)

## Sample response

```json
{
  "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
    }
  }
}
```

## Use cases

- **Dynamic Theme Generation** — White-label SaaS dashboards build branded interface themes instantly by supplying a customer's primary brand HEX to retrieve complementary UI shades and legible text colors.
- **Website Builder Customization** — When site owners select a key accent color, CMS site editors generate matching color sets to style page headers, background sections, and button borders.
- **E-Commerce Product Showcases** — Match catalog item tones to surrounding promotional banners by creating monochromatic or contrasting palettes directly from product hero image colors.
- **Design Tool Integrations** — Digital illustration software presents automated analogic or triadic color swatches to artists based on their current active brush color.

## SDKs

- **npm** — `npm install @apiverve/colorpalette` (https://www.npmjs.com/package/@apiverve/colorpalette)
- **NuGet** — `dotnet add package APIVerve.API.ColorPaletteGenerator` (https://www.nuget.org/packages/APIVerve.API.ColorPaletteGenerator)
- **Source** — https://github.com/apiverve/colorpalette-api

## More

- Full reference: https://docs.apiverve.com/ref/colorpalette
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
