<Heatmap>'s legend uses a blue to cyan to green to yellow to red rainbow:
linear-gradient(to right, rgb(0, 0, 255), rgb(0, 255, 255), rgb(0, 255, 0), rgb(255, 255, 0), rgb(255, 0, 0))(stx-heatmap__legend-gradient, from dist/heatmap.js.)
A rainbow is the one ramp a sequential scale should not use, for two reasons that both show up in real reading:
It invents boundaries that are not in the data. The transitions through cyan and yellow are perceptually much sharper than the ones through blue-cyan or red-yellow, so a reader sees bands and infers categories where the data is continuous.
It is not monotonic in lightness. Yellow is far lighter than both the blue and the red ends, so the ramp goes light in the middle. Printed in greyscale, or seen by a reader with a colour vision deficiency, "high" and "low" become indistinguishable while the middle stands out.
The conventional fix is a single hue from light to dark, which keeps lightness monotonic and stays readable in greyscale and under every common deficiency. If a two-ended scale is genuinely wanted, that is a diverging ramp: two hues with a neutral grey midpoint, never a hue at the middle.
A theme-able default would be better still. In an app with its own tokens the heatmap is currently the one component that cannot follow them, since the ramp is hardcoded; reading a custom property with the current gradient as a fallback would let an app supply its own hue without changing any behaviour for existing users.
Noticed because an app component named Heatmap resolved to this built-in rather than the app's own, and the rainbow was the giveaway: it could not have come from that app's tokens. Worth considering whether a built-in should lose a name collision to an app's resources/components, or at least say that it won.
Environment: @stacksjs/stx as resolved by stacks@0.70.371, Bun 1.3.14.