ColorGen API Documentation
Learn how to integrate the ColorGen API into your projects and generate beautiful palettes in seconds.
Base URL
https://yourdomain.com/api/colors
Endpoints
1. Get Random Palette
Generates a set of random colors.
GET /api/colors
Example Response:
[ "#A1B2C3", "#FFD700", "#33FF57", "#FF5733", "#6A0DAD" ]
2. Get Palette by Base Color
Generates a palette based on a specific base color.
GET /api/colors?base=ff5733
Example Response:
[ "#FF5733", "#FF8A65", "#FFD54F", "#4DB6AC", "#9575CD" ]
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| base | string (hex) | Base color to generate related palette from. |
Example Usage (JavaScript)
fetch("https://yourdomain.com/api/colors?base=ff5733")
.then(res => res.json())
.then(data => console.log(data));