Spectrum

The Spectrum provides a color palette based on a given hexadecimal color code.

Base URL

"https://openapi-idk8.onrender.com"

Endpoints

  • GET /color/:hex: Retrieve a color palette based on the provided hexadecimal color code.

GET /color/:hex

Retrieves a color palette based on the provided hexadecimal color code.

URL Parameters

  • hex: The hexadecimal color code (without the '#' symbol) for which to generate the color palette. This parameter is required.

Sample Request

GET "https://openapi-idk8.onrender.com/color/ffffff"

Sample Response

{
  "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
    }
  ]
}

Error Handling

If there is an error or the hex parameter is missing, the API responds with an appropriate error message and status code.

Additional Information

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.