Recomputes a theme's per-stop worst-hue chroma caps from its own hues and
the palette lightness each stop resolves to, then returns
_palette_chroma_NN caps wherever the baked ones no longer fit - the fix
for a theme (rotated hues, a monochrome collapse, a moved lightness ramp)
whose gamut headroom the baked worst-hue table misjudges. The caps are
derived data beside the theme, never in it: a theme can't set an internal
variable, so they render through render_theme_style's caps option and
recomputing them for the same theme gives the same caps.
Each stop's cap is computed at the lightness the resolution core resolves
for the stop in that scheme - the theme's endpoint-and-curve ramp - so the
caps describe the same colors check_theme gates.
A stop is emitted when either scheme's recomputed cap is tighter than the
baked value, or looser by more than the emit epsilon. Nothing is emitted
when a hue fails to resolve to a number, since caps computed without it
could overshoot its gamut, and a stop whose lightness fails to resolve is
skipped. An override emits both slots together, so a
one-scheme override can't silently kill the base default's other slot by
cascade-layer order, collapsing to a single slot in the base position when
the two rendered values coincide.
A stanced theme's two schemes resolve to the stanced appearance through the
mirror, so its caps are baselined against the stanced scheme's baked table -
the values the mirror already re-slots - and a stance alone (hues and
lightness unmoved) emits nothing. Its overrides coincide across schemes and
emit single-slot unless the theme authors a dark slot that splits them.
The caps bound the requested chroma only: chroma_scale and the per-slot
*_chroma_scale multipliers apply above the clamp. A theme that raises one
past 1 clips by design - its gamut failures survive the compile, and a cap
the compile loosens can add to them, since the multiplier then pushes more
stops past the looser cap. Gate the theme with them through
check_theme(theme, {caps}).