ADR-0017: Candle direction in the ok and danger roles, with hollow and solid bodies
- Status: Proposed
- Date: 2026-12-01
Context
Section titled “Context”A candlestick mark (chart.md) draws open, high, low and close per row. Readers tell a rising candle from a falling one at a glance, so the direction needs a visual encoding. Two rules constrain it:
- Colour never carries meaning alone (chart.md; WCAG 2.2 success criterion 1.4.1, Use of Color). The most familiar direction colours, green and red, are the pair that readers with deuteranopia or protanopia confuse most.
- Every chart colour is a theme token with a literal fallback (ADR-0005), so light, dark and named themes restyle a chart by CSS alone.
The tokens --merlion-ok (#1a7f37) and --merlion-danger (#cf222e) already exist, with values in every theme @fractalboxdev/merlion-themes ships, light and dark.
Decision
Section titled “Decision”A rising candle, close at or above open, draws in the ok role with a hollow body filled with the background colour. A falling candle draws in the danger role with a solid body. The item carries merlion-chart-up or merlion-chart-down; the body carries merlion-chart-hollow or merlion-chart-solid. The four rules appear in the stylesheet only when the chart draws a candle.
Options considered
Section titled “Options considered”| Option | Buys | Costs |
|---|---|---|
ok and danger, hollow rising and solid falling bodies |
Direction readable without colour, in greyscale print and for colour-blind readers; no new token; every shipped theme already tunes both colours | A page that reads red as rising overrides both tokens on its charts |
ok and danger, solid bodies only |
The common screen convention | Direction by colour alone, which the chart contract forbids |
New tokens --merlion-rise and --merlion-fall |
Direction colours independent of diagram roles | Two more tokens for every theme, the palette reader, the stylesheet compiler and the themes package to define and test |
Series colours from a direction field, as hosts draw candles with two interval marks today |
No new rule | A legend entry per direction, a field every host derives, and direction by colour alone |
| One neutral colour, hollow and solid bodies | Colour-free | Loses the colour cue that most readers scan by first |
Criteria
Section titled “Criteria”The colour rule and theming by tokens ruled out solid-only bodies and series colours. Between new tokens and the existing roles, the existing roles decided it: no new surface, and every theme already defines them.
Consequences
Section titled “Consequences”- Easier: a theme that sets
--merlion-okand--merlion-dangerrecolours candles with no further change, and the body’s fill shows the direction in any colour. - Harder:
okanddangernow mean “rising” and “falling” in charts as well as “success” and “failure” in diagrams. A page that reads red as rising sets both tokens on.merlion-chart, which scopes the change to its charts. - Expensive to reverse: the classes
merlion-chart-up,merlion-chart-down,merlion-chart-hollowandmerlion-chart-solid. - Unmeasured: no reader study compares hollow and solid bodies with colour alone.