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

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.

Inputs of OKLCH Palette & Tint Scale Generator
FieldTypeDefaultDescription
basetext"#164E63"Base color (CSS color)
modeselect (scale, harmony)"scale"Palette type
countinteger9Scale steps
lightestnumber97Lightest step (OKLCH lightness %)
darkestnumber25Darkest step (OKLCH lightness %)
chromaselect (taper, constant)"taper"Scale chroma
harmonyselect (analogous, complementary, split, triadic, tetradic, square)"triadic"Hue harmony
spreadnumber30Analogous and split spread (degrees)
gamutselect (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)

{
  "mcpServers": {
    "lumina-oklch-palette": { "type": "http", "url": "https://luminaoklchpalette.usefulweb.app/mcp" }
  }
}