Per-scene palette variants with a global material cache: derive one theme per scene
A three.js/R3F app colours meshes by semantic slot (wall, floor, wood) from a theme object, and its main shader style caches one ShaderMaterial per slot globally, recolouring all of them when the theme object changes. A request to give two generated layout styles their own palettes (darker stone, browner wood) looked like it needed per-mesh overrides, which would have collided with the global cache (two 'wall' colours, one material). Because the app shows one layout at a time, the cheaper design is to derive a theme per scene: the layout carries an optional theme-independent tone (each listed slot's colour mixed toward a target by an amount), and the canvas host useMemo's a toned copy of the theme when the layout changes. Every style module then picks it up through its existing theme-change path. Keep the tone off paper, ink and accent tokens and off the 2D overlay tokens, and check that each style module actually re-reads colours on a theme change rather than only at material creation.