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
POST https://luminacolorconverter.usefulweb.app/api/v1/calculate– run Color Converter & Gamut Mapper (OKLCH, Lab, P3)GET https://luminacolorconverter.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
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.
| Field | Type | Default | Description |
|---|---|---|---|
color | text | "oklch(0.7 0.25 145)" | CSS color (HEX, name, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch() or color()) |
nearest | integer | 5 | Nearest 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)
- Streamable HTTP endpoint:
https://luminacolorconverter.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
lumina_color_converter - Local stdio connector:
node src/mcp-stdio.ts --tool=lumina-color-converter
{
"mcpServers": {
"lumina-color-converter": { "type": "http", "url": "https://luminacolorconverter.usefulweb.app/mcp" }
}
}