From a48d45b4df6a52d0109fd190903a243f5c1a6f05 Mon Sep 17 00:00:00 2001 From: type-two Date: Fri, 17 Jul 2026 20:14:33 +1000 Subject: [PATCH] [ui] accent: read MachineDef.accent first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Order 5, and the half that actually matters — the precedence comment landed in the research commit but the lookup itself didn't get staged. Precedence now matches LANE-RENDER exactly: art-directed accent wins, else the first-output derivation, else the codex id/kind tables for machines that output nothing. Co-Authored-By: Claude Opus 4.8 --- fktry/src/ui/palette.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fktry/src/ui/palette.ts b/fktry/src/ui/palette.ts index 8ba5e40..b3c4ccb 100644 --- a/fktry/src/ui/palette.ts +++ b/fktry/src/ui/palette.ts @@ -52,7 +52,10 @@ export function machineChassis(def: MachineDef): string { export type AccentFn = (def: MachineDef) => string; /** - * Accent lookup: the colour of the first thing the machine makes, else the codex table. + * Accent lookup, in the precedence LANE-RENDER uses (v4 — confirmed identical in NOTES): + * 1. `MachineDef.accent` — art direction wins outright. + * 2. the colour of the first item the machine outputs — the documented derivation. + * 3. the codex id/kind tables below, for machines that output nothing. * Curried over GameData because the derivation needs recipes + items. */ export function createAccentLookup(data: GameData): AccentFn { @@ -60,6 +63,8 @@ export function createAccentLookup(data: GameData): AccentFn { const items = new Map(data.items.map((i) => [i.id, i])); return (def) => { + if (def.accent) return def.accent; + for (const rid of def.recipes) { const r = recipes.get(rid); if (!r) continue;