Expand description
Palette-consumption probe — the machine-readable witness that a component
consumed the active Theme. theme records the palette name it returns
here; a headless test resets the probe, renders one component,
then reads painted to assert the component painted with the
palette it was given (not default). Thread-local so parallel test cells don’t
interfere; cheap (a Cell), and a no-op cost for production renders that never
read it.
Functions§
- painted
- The palette name the most recent
themecall handed out on this thread, orNoneif nothing has read the theme sincereset. A component that paints with the active palette returnsSome(palette_name). - record
- Record the palette a
themecall handed out. Called from insidetheme(ui); the last palette read this paint wins (a facet may read the theme several times — they’re all the active palette). - reset
- Clear the probe before rendering a component, so
paintedreflects only that component’s paint.