The Spectrum provides a color palette based on a given hexadecimal color code.
"https://openapi-idk8.onrender.com"
GET /color/:hex
: Retrieve a color palette based on the provided hexadecimal color code.Retrieves a color palette based on the provided hexadecimal color code.
hex
: The hexadecimal color code (without the '#' symbol) for which to generate the color palette. This parameter is required.GET "https://openapi-idk8.onrender.com/color/ffffff"
{
"paletteTitle": "White",
"colors": [
{
"name": "White",
"hex": "#ffffff",
"rgb": {
"r": 255,
"g": 255,
"b": 255
},
"hsl": {
"h": 0,
"s": 0,
"l": 100
},
"lab": {
"l": 100,
"a": 0,
"b": 0
},
"luminance": 170.48157,
"luminanceWCAG": 1,
"bestContrast": "black",
"swatchImg": {
"svgNamed": "/v1/swatch/?color=ffffff&name=White",
"svg": "/v1/swatch/?color=ffffff"
},
"requestedHex": "#ffffff",
"distance": 0
}
]
}
If there is an error or the hex
parameter is missing, the API responds with an appropriate error message and status code.
The hex
parameter allows the user to specify the base color for generating a palette. The endpoint fetches a corresponding color palette from an external API.