// 主题选择:深色 / 浅色 / 墨绿直接上屏;跟随系统只在深色与浅色之间解析。 export type ThemeChoice = 'dark' | 'light' | 'molv' | 'system' export type PaintedTheme = 'dark' | 'light' | 'molv' export function resolveTheme(choice: string, prefersDark: boolean): PaintedTheme { if (choice === 'system') return prefersDark ? 'dark' : 'light' if (choice === 'light' || choice === 'molv') return choice return 'dark' } export function isThemeChoice(value: string): value is ThemeChoice { return value === 'dark' || value === 'light' || value === 'molv' || value === 'system' }