{
  "openapi": "3.1.1",
  "info": {
    "title": "Color Harmony & Shift Generator API",
    "version": "1.0.0",
    "summary": "Build HSL harmonies with eased shifts, locked colors and reusable palette exports.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://luminapalettegenerator.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Build HSL harmonies with eased shifts, locked colors and reusable palette exports.",
        "description": "Generate 2–24 opaque colors using six HSL harmonies and hue, saturation and lightness travel. Preserve chosen positions with color locks and download HEX, CSS, GPL, JASC-PAL and SVG palettes.\n\nMethodology:\n- Convert the base sRGB color to HSL. Hue offsets repeat at 0/180 for complementary, 0/150/210 for split, 0/120/240 for triadic and 0/90/180/270 for tetradic.\n- For index i, shift progress is i/(count-1), transformed by linear, quadratic ease-in, quadratic ease-out or smoothstep. Add travel to the base HSL values; monochromatic ignores hue travel.\n- Wrap hue and clamp saturation/lightness to 0–100%; round sRGB channels to eight bits. Locked positions replace generated values exactly. HSL spacing is not perceptually uniform.\n- HEX, GPL, JASC-PAL, CSS and SVG exports keep order and duplicate colors. Palette Studio opens these colors as an independent group.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "lumina_palette_generator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LuminaPaletteGeneratorInput"
              },
              "examples": {
                "example1": {
                  "summary": "A tidal color ramp",
                  "value": {
                    "base": "#164E63",
                    "count": 6,
                    "harmony": "analogous",
                    "hue": 45,
                    "saturation": -18,
                    "lightness": 48,
                    "easing": "smooth"
                  }
                },
                "example2": {
                  "summary": "Pure triad with a locked first color",
                  "value": {
                    "base": "#FF0000",
                    "count": 3,
                    "harmony": "triadic",
                    "hue": 0,
                    "saturation": 0,
                    "lightness": 0,
                    "easing": "linear",
                    "locks": "1=#123456"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LuminaPaletteGeneratorResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "LuminaPaletteGeneratorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "base": {
            "title": "Base HEX color",
            "type": "string",
            "maxLength": 7,
            "default": "#164E63"
          },
          "count": {
            "title": "Color count",
            "type": "integer",
            "minimum": 2,
            "maximum": 24,
            "default": 6
          },
          "harmony": {
            "title": "HSL harmony",
            "type": "string",
            "enum": [
              "monochromatic",
              "analogous",
              "complementary",
              "split",
              "triadic",
              "tetradic"
            ],
            "default": "analogous"
          },
          "hue": {
            "title": "Hue travel (degrees)",
            "type": "number",
            "minimum": -360,
            "maximum": 360,
            "default": 45
          },
          "saturation": {
            "title": "Saturation travel (percentage points)",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": -18
          },
          "lightness": {
            "title": "Lightness travel (percentage points)",
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "default": 48
          },
          "easing": {
            "title": "Shift easing",
            "type": "string",
            "enum": [
              "linear",
              "ease-in",
              "ease-out",
              "smooth"
            ],
            "default": "smooth"
          },
          "locks": {
            "title": "Locked positions (for example 1=#164E63; 3=#FFFFFF)",
            "type": "string",
            "maxLength": 400,
            "default": ""
          }
        },
        "required": []
      },
      "LuminaPaletteGeneratorResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "colors",
              "exports"
            ],
            "properties": {
              "colors": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "exports": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "hex",
                  "gpl",
                  "jasc",
                  "css",
                  "svg"
                ],
                "properties": {
                  "hex": {
                    "type": "string"
                  },
                  "gpl": {
                    "type": "string"
                  },
                  "jasc": {
                    "type": "string"
                  },
                  "css": {
                    "type": "string"
                  },
                  "svg": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}