DEV Community

miccho27
miccho27

Posted on

Free Color Palette Generator API — Harmonies, Gradients & WCAG Contrast Check

Building a Design System? Start with Colors.

Picking colors that work together is harder than it looks. You need harmonious palettes, accessible contrast ratios, and gradient stops — all programmatically.

Color Palette Generator API

A free REST API that generates color schemes based on color theory, checks WCAG accessibility, and creates gradient stops.

Generate a Palette

curl "https://color-palette-generator-api.p.rapidapi.com/palette?color=%23FF6B35&type=complementary" \
  -H "X-RapidAPI-Key: YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "base": "#FF6B35",
  "type": "complementary",
  "palette": ["#FF6B35", "#3594FF"],
  "hex": ["#FF6B35", "#3594FF"],
  "rgb": ["rgb(255,107,53)", "rgb(53,148,255)"],
  "hsl": ["hsl(16,100%,60%)", "hsl(212,100%,60%)"]
}
Enter fullscreen mode Exit fullscreen mode

Harmony Types

Type Colors Description
complementary 2 Opposite on color wheel
triadic 3 120° apart
analogous 3 Adjacent colors
split-complementary 3 Base + 2 near-complement
tetradic 4 Rectangle on wheel
monochromatic 5 Same hue, varied lightness

WCAG Contrast Check

curl "https://color-palette-generator-api.p.rapidapi.com/contrast?foreground=%23FFFFFF&background=%23FF6B35"
Enter fullscreen mode Exit fullscreen mode
{
  "ratio": 3.12,
  "AA_normal": false,
  "AA_large": true,
  "AAA_normal": false,
  "AAA_large": false
}
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Design systems: Auto-generate accessible color tokens
  • Theming: Create dark/light mode palettes from a single brand color
  • Data visualization: Generate distinct, harmonious chart colors
  • CSS gradients: Get stop points for smooth transitions

Free Tier

100 requests/month. No credit card.

Try it free: Color Palette API on RapidAPI

Top comments (0)