MCP SERVER

CHROMATA

OKLCH color science for dark interfaces — 21 hue families, perceptually uniform shade scales, and scheme-based coordination.

5
Tools
21
Hue families
231
Total shades
5
Distribution functions
TOOLS
ToolPurposeReturns
paletteFull 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
resolveTurns 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
identifyReverse 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_functionsFive 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_sequenceCross-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)
THE OKLCH PIPELINE

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.

Hue Definitions
17 chromatic + 4 neutral

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.

Shade Scales
11 steps per hue (50–950)

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.

Scheme Coordination
Curated sequences on dark surfaces

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.

Semantic Roles
Intent over identity

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.

Color Functions
5 distribution strategies

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.

INTEGRATION
Upstream — Library Consumers
xhtml-tools · svg-tools

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.

Downstream — Scheme Persistence
data/schemes.json

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.