/** * TUI theme — colors that vary between dark and light terminal * backgrounds. Pulled into one place so a future theme picker, env * var, or auto-detection only needs to swap the active object. * * Severity colors (red/yellow/green) are kept theme-agnostic — those * are ANSI named colors that respect the user's terminal palette and * read correctly on both dark and light backgrounds. * * Selected via `--theme=dark|light` on `celilo system audit --tui`. * Default: `dark`. We don't auto-detect terminal background — the * standard probe (`COLORFGBG` env var, or OSC 11) is unreliable * across terminals, and an explicit flag is more honest than a guess * that's right 70% of the time. */ export type ThemeName = 'dark' | 'light'; export interface Theme { /** * Dialog background. Should contrast strongly with the typical * terminal background on this theme — pure black on dark themes, * pure white on light themes. */ dialogBg: 'black' | 'white'; /** Foreground text color inside dialogs. Inverse of dialogBg. */ dialogFg: 'white' | 'black'; } const DARK: Theme = { dialogBg: 'black', dialogFg: 'white', }; const LIGHT: Theme = { dialogBg: 'white', dialogFg: 'black', }; export function getTheme(name: ThemeName | undefined): Theme { return name === 'light' ? LIGHT : DARK; }