(theme: ThemeName)
| 41 | * missing / invalid files fall back to dark palette. |
| 42 | */ |
| 43 | export async function getColorPalette(theme: ThemeName): Promise<ColorPalette> { |
| 44 | if (theme === 'light') return getBuiltInPalette('light'); |
| 45 | if (theme === 'dark') return getBuiltInPalette('dark'); |
| 46 | if (theme === 'auto') { |
| 47 | const detected = await detectTerminalTheme(); |
| 48 | return getBuiltInPalette(detected); |
| 49 | } |
| 50 | // custom theme |
| 51 | const custom = await loadCustomThemeMerged(theme); |
| 52 | return custom ?? getBuiltInPalette('dark'); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Synchronous fallback used by paths that cannot wait on terminal probes. |
no test coverage detected