// Small color maps for the "command center" theme. Pure + shared so the event // feed, nation panel, and any future view all agree on a type/status → color. import type { EventOutcome, EventType, RelationStatus } from '@shared/types'; export const EVENT_COLORS: Record = { military: '#ef4444', diplomatic: '#3b82f6', economic: '#22c55e', political: '#f59e0b', social: '#06b6d4', disaster: '#f97316', scientific: '#a855f7', cultural: '#ec4899', }; export const RELATION_COLORS: Record = { ally: '#22c55e', neutral: '#94a3b8', rival: '#f59e0b', hostile: '#f97316', war: '#ef4444', }; export const OUTCOME_COLORS: Record = { success: '#22c55e', failure: '#ef4444', partial: '#f59e0b', neutral: '#94a3b8', // (v0.30, #50) engine-emitted "invasion repelled" — a muted, darker red so it // reads as a defensive failure distinct from a bright outright `failure`. repelled: '#9f1239', }; /** * A 0–100 value → a color on a smooth red → yellow → green ramp, for stat bars. * Low values read as "danger" (red), high values as "strong" (green). Pure so the * dossier and any future gauge agree. */ export function statValueColor(v: number): string { const x = Math.max(0, Math.min(100, v)); const hue = x * 1.2; // 0 → red, 60 → yellow, 120 → green return `hsl(${Math.round(hue)} 72% 46%)`; }