Color Harmony API
This API allows you to generate color schemes based on a given color. You can specify the color schemes to generate, as well as the formats to return the colors in.
If you appreciate our API and would like to support us, consider buying our book. It's a great way to deepen your understanding while helping us continue providing quality services. You can find the book at our book page. Your support is greatly appreciated!
GET/api/v1/color-harmony
Making A Request
- Name
colors
- Type
- string
- Description
A color to be used for the base of the color scheme.
- Name
formats
- Type
- string || string[] || undefined
- Description
The formats to return the blended color in. Defaults to hex, rgb, and hsl.
- Name
schemes
- Type
- string || string[] || undefined
- Description
Optional. Specify the color schemes to generate (e.g., "analogous,monochromatic").
Making a request
GET
/api/v1/color-harmonycurl "https://palettespro.com/api/v1/color-harmony?color=<COLOR_VALUE>&formats=<FORMATS>&schemes=<SCHEMES>"
Example Response
{
"analogous": [
{"hsl": {"h": 0, "s": 100, "l": 50}, "hex": "#ff0000", "rgb": {"r": 255, "g": 0, "b": 0}},
...
],
"complementary": [
{"hsl": {"h": 180, "s": 100, "l": 50}, "hex": "#00ffff", "rgb": {"r": 0, "g": 255, "b": 255}},
...
],
...
}
Example Error Response
{
"error": "Invalid color format."
}