/** * LANE-UI — machine accent colors for build-bar icons. * * `MachineDef.color` (contracts v2) is the source of truth and wins whenever LANE-DATA * has filled it — the same value LANE-RENDER tints its placeholder boxes with, so the * bar and the world agree about what a quantizer looks like. * * The tables below are the round-1 stopgap, kept as fallback: transcribed from * docs/FKTRY_LORE.md §4 (each machine's ASSET block names its impossible element). * Order: data color, else id override, else kind fallback, else house green. Never * crashes on a machine we've never heard of. */ import type { MachineDef, MachineKind } from '../contracts'; const BY_ID: Record = { 'seam-extractor': '#c8a03f', // grimy yellow chassis belt: '#5a7a5a', demuxer: '#ff3fd4', // the magenta output chute quantizer: '#e8e0ff', // HF dust leaking from the seams 'mosh-reactor': '#ff7a3f', // melt, seen through the porthole 'decode-asic': '#3fffe0', // serene LED face shipper: '#d8ffd8', // THE SCREEN's own light }; const BY_KIND: Record = { extractor: '#c8a03f', belt: '#5a7a5a', crafter: '#3fffe0', splitter: '#7fb0ff', power: '#3fffe0', buffer: '#7fb0ff', shipper: '#d8ffd8', }; export function machineColor(def: MachineDef): string { return def.color || BY_ID[def.id] || BY_KIND[def.kind] || '#d8ffd8'; }