Colour Palette Generator

Colour Palette Generator API

Design

Generate harmonious colour palettes with customizable options.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

100 requests per minute

Endpoints

1 endpoint available

Overview

The Colour Palette Generator API creates harmonious, perceptually distinct colour palettes using the iwanthue algorithm. Generate palettes optimized for human perception, ensuring colours are visually distinguishable from each other.

How It Works

The API uses advanced colour science to generate palettes:

  • Perceptual Distinction - Colours are chosen to be maximally distinguishable to human vision
  • Colour Space Optimization - Uses CIE Lab colour space for accurate perception modeling
  • Clustering Algorithms - Two algorithms available for different distribution patterns

Clustering Algorithms

  • force-vector - Spreads colours using force-directed positioning (more organic distribution)
  • k-means - Uses k-means clustering for more structured colour groupings

Use Cases

  • UI/UX design colour schemes
  • Data visualization with distinct categories
  • Brand identity development
  • Web design and theming
  • Infographic creation
  • Chart and graph colouring

Endpoints

POST
/v1/tools/colour-palette-generator
Generate a harmonious colour palette

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
colourCount
number
OptionalNumber of colours to generate (2-20)Default: 5
clustering
string
Enum: force-vector, k-means
OptionalClustering algorithm to useDefault: force-vector
seed
string
OptionalSeed value for reproducible results
quality
number
OptionalGeneration quality (1-100). Higher values produce better results but take longerDefault: 50

Response Example

{
  "success": true,
  "palette": [
    "#e63946",
    "#f4a261",
    "#2a9d8f",
    "#264653",
    "#e9c46a"
  ],
  "settings": {
    "colourCount": 5,
    "clustering": "force-vector",
    "quality": 50
  }
}

Error Codes

400
Invalid request body or colourCount out of range
401
Missing or invalid API key
429
Rate limit exceeded
500
Internal server error

Code Examples

# Generate a 5-colour palette with default settings
curl -X POST https://api.opentools.ca/v1/tools/colour-palette-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

# Generate a 10-colour high-quality palette with a seed
curl -X POST https://api.opentools.ca/v1/tools/colour-palette-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"colourCount": 10, "quality": 100, "seed": "my-brand", "clustering": "k-means"}'

Ready to get started?

Create an API key to start using the Colour Palette Generator API.