Chart Color System
v0.1.2Solve, audit and simulate colorblind-safe chart palettes.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
solve_palette Solve a chart palette
Generate a categorical chart palette of n colors (1-12) that maximizes perceptual separation under normal vision and colorblindness, with the given brand colors locked as anchors in slot order. Returns the palette, the worst pair distances, the engine's relaxation notes, a full accessibility audit against the background, and a link to open it in the app. Honest cap is 6 slots; above that the result says so.
| Parameter | Type | Description |
|---|---|---|
anchors | array | Brand or required colors, kept exactly, in slot order (CSS syntax) |
background | string | Chart background color |
grid | string | Gridline color; defaults to a light or dark gray to match the background |
n | integer | Number of categorical slots |
posture | string | kpi: few strong colors; comparative: balanced; exploratory: many muted |
audit_palette Audit a chart palette
Audit existing chart colors for accessibility: pairwise OKLab separation under normal vision, deuteranopia, protanopia, tritanopia and achromatopsia, plus WCAG 2.2 non-text contrast (3:1) of every color against the chart background. A translucent color is composited over the background first and reported as rendered. Returns a pass / warn / fail verdict with the numbers behind it. Set ramp=true for sequential or diverging scales, whose steps are meant to be close.
| Parameter | Type | Description |
|---|---|---|
colors * | array | Palette colors in slot order (CSS syntax) |
background | string | Chart background color |
ramp | boolean | true for a sequential or diverging scale (skips pairwise separation) |
simulate_palette Simulate colorblind vision
Show what each color looks like to readers with deuteranopia, protanopia, tritanopia or achromatopsia (published Machado 2009 matrices), so an assistant can describe or render the palette as a colorblind reader sees it.
| Parameter | Type | Description |
|---|---|---|
colors * | array | Colors in slot order (CSS syntax) |
modes | array | Vision modes to simulate; default all |
build_ramp Build a sequential or diverging ramp
Build an evenly spaced perceptual (OKLab) color scale: sequential from start to end, or diverging from start through mid to end. Returns the steps and a background-contrast audit (pairwise separation is not judged for ramps).
| Parameter | Type | Description |
|---|---|---|
end * | string | Last color (or the positive end) |
kind * | string | |
start * | string | First color (or the negative end of a diverging scale) |
background | string | |
mid | string | Middle color for a diverging scale; default a neutral near the background |
steps | integer |