API & MCP

Everything a person can do on Color Converter & Gamut Mapper (OKLCH, Lab, P3), a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Color Converter & Gamut Mapper (OKLCH, Lab, P3)

Paste a HEX code, CSS named color or any CSS Color 4 function. Get every color space, sRGB and Display P3 gamut checks, the CSS gamut-mapped HEX instead of naive clipping, WCAG contrast against white and black, and the nearest CSS named colors by CIEDE2000.

Inputs of Color Converter & Gamut Mapper (OKLCH, Lab, P3)
FieldTypeDefaultDescription
colortext"oklch(0.7 0.25 145)"CSS color (HEX, name, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch() or color())
nearestinteger5Nearest CSS named colors to list

Example request

A vivid OKLCH green outside sRGB

curl -X POST https://luminacolorconverter.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"color":"oklch(0.7 0.25 145)","nearest":5}'

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-color-converter": { "type": "http", "url": "https://luminacolorconverter.usefulweb.app/mcp" }
  }
}