API & MCP
Everything a person can do on OKLCH Palette & Tint Scale Generator, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://luminaoklchpalette.usefulweb.app/api/v1/calculate– run OKLCH Palette & Tint Scale GeneratorGET https://luminaoklchpalette.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
OKLCH Palette & Tint Scale Generator
Start from any CSS color and generate a 3–15 step lightness scale or an OKLCH hue harmony. Colors are gamut-mapped to sRGB or Display P3 with the CSS Color 4 algorithm; each step reports contrast with white and black, and you can download CSS with HEX fallbacks, GPL, JASC-PAL and SVG.
| Field | Type | Default | Description |
|---|---|---|---|
base | text | "#164E63" | Base color (CSS color) |
mode | select (scale, harmony) | "scale" | Palette type |
count | integer | 9 | Scale steps |
lightest | number | 97 | Lightest step (OKLCH lightness %) |
darkest | number | 25 | Darkest step (OKLCH lightness %) |
chroma | select (taper, constant) | "taper" | Scale chroma |
harmony | select (analogous, complementary, split, triadic, tetradic, square) | "triadic" | Hue harmony |
spread | number | 30 | Analogous and split spread (degrees) |
gamut | select (srgb, display-p3) | "srgb" | Target gamut |
Example request
A nine-step teal scale
curl -X POST https://luminaoklchpalette.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"base":"#164E63","mode":"scale","harmony":"triadic","spread":30,"count":9,"lightest":97,"darkest":25,"chroma":"taper","gamut":"srgb"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://luminaoklchpalette.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
lumina_oklch_palette - Local stdio connector:
node src/mcp-stdio.ts --tool=lumina-oklch-palette
{
"mcpServers": {
"lumina-oklch-palette": { "type": "http", "url": "https://luminaoklchpalette.usefulweb.app/mcp" }
}
}