MCP SERVER
OKLCH color science for dark interfaces — 21 hue families, perceptually uniform shade scales, and scheme-based coordination.
| Tool | Purpose | Returns |
|---|---|---|
| palette | Full catalog dump — all 21 hue families with shade previews at key steps, every registered scheme with its color sequence and surface palette, and semantic role mappings. One call, zero parameters. | Hue shades, scheme definitions, role mappings |
| resolve | Turns a color reference into bg/text/border RGB strings. Accepts hue names, shade refs (sky-500), semantic roles (primary, danger), and alpha expressions. Scheme-aware — cloudflare shifts to dark-surface shade positions automatically. | bg, text, border RGB strings |
| identify | Reverse lookup — takes RGB values and returns the palette name and shade step. Array mode identifies multiple colors and detects which scheme they belong to. Exact match only. | Color name + shade, scheme detection |
| color_functions | Five composable distribution strategies for assigning hues to N items. Catalog mode explains each function with semantic use cases. Preview mode shows exactly what colors N items would receive. | Per-item hue assignments with shade mappings |
| resolve_sequence | Cross-block color coordination. Given a scheme and block manifest (count + palette role per block), returns coordinated color arrays. Blocks maintain a cursor through the scheme's color sequence — roles like mute, complement, and converge modulate shade and energy. | Per-block color arrays (bg/text/border per item) |
Every color in the system starts as two numbers: a hue angle and a peak chroma in OKLCH space. From there, a deterministic pipeline produces everything renderers need.
Each hue is an OKLCH angle (H) and base chroma (C). The chromatic ring runs from red (H=25) through vermillion, orange, amber, yellow, lime, emerald, teal, cyan, sky, azure, blue, indigo, violet, purple, fuchsia, and rose. Four neutrals (slate, gray, stone, neutral) sit near zero chroma. Angles are spaced for perceptual distinctness — no two adjacent hues look alike.
Each hue generates 11 perceptually uniform shades by varying lightness while scaling chroma proportionally. Every shade is gamut-clamped to sRGB via chroma reduction — the algorithm preserves hue angle and lightness, only pulling chroma inward until the color fits. Wide-gamut hues like violet (C=0.23) push to ~85% sRGB utilization at shade-500.
A scheme is an ordered color sequence plus a surface palette (four dark background layers: base, deep, mid, raised) and shade mappings that control how hue names resolve to bg/text/border positions. The cloudflare scheme maps bg→500, text→50, border→400 — reversed from the light-mode default of bg→50, text→900, border→500.
Six roles — primary, accent, success, warning, danger, info — map abstract intent to concrete hues. The default mapping uses blue for primary and sky for info. The cloudflare scheme overrides: primary becomes orange, accent becomes vermillion, info becomes teal. Same semantic call, different visual identity per context.
Functions assign hues to N items using different strategies. Grad walks the OKLCH hue ring between two endpoints. Mono graduates shades within a single hue. Div creates diverging extremes with a neutral center. Pair alternates two hues. Accent colors everything one hue except the last item. Each function can override per-item shade positions for depth effects.
Both rendering servers import chromata as a workspace dependency. xhtml-tools adds resolveColors() for Confluence XHTML — semantic roles, accent blending, contrast presets. svg-tools adds getThemeContext() for SVG canvas colors, node shade positions, and arrow styling. Neither server defines its own colors.
Schemes are stored in a JSON file and loaded at module init. addScheme() validates color names against the palette, checks shade steps, and writes back. Built-in schemes are protected from deletion. The identify tool's scheme detection enables retheme operations — swap one scheme for another by reverse-mapping RGB values to palette positions.
The server that colors every other server's output.