types.ts (1540B)
1 import type { ThemeMode } from "../core/types.js"; 2 3 export type HslTuple = [number, number, number]; 4 5 export type ThemeSurfaceKey = 6 | "_" 7 | "_w" 8 | "_a" 9 | "edge" 10 | "blur" 11 | "err" 12 | "focus"; 13 14 export type ThemeGlyphKey = 15 | "_" 16 | "_a" 17 | "_pl" 18 | "_d" 19 | "hl" 20 | "hl_a" 21 | "shade" 22 | "label"; 23 24 export interface ThemeLayer0 { 25 surfaces: { 26 _: HslTuple; 27 _w: HslTuple; 28 _a: HslTuple; 29 edge: HslTuple; 30 blur: HslTuple; 31 }; 32 glyphs: { 33 _: HslTuple; 34 _a: HslTuple; 35 _pl: HslTuple; 36 hl: HslTuple; 37 hl_a: HslTuple; 38 shade: HslTuple; 39 label: HslTuple; 40 }; 41 } 42 43 export interface ThemeLayer1 { 44 surfaces: { 45 _: HslTuple; 46 _a: HslTuple; 47 edge: HslTuple; 48 err: HslTuple; 49 focus: HslTuple; 50 }; 51 glyphs: { 52 _: HslTuple; 53 _a: HslTuple; 54 _d: HslTuple; 55 _pl: HslTuple; 56 hl: HslTuple; 57 hl_a: HslTuple; 58 shade: HslTuple; 59 label: HslTuple; 60 }; 61 } 62 63 export interface ThemeLayer2 { 64 surfaces: { 65 _: HslTuple; 66 _a: HslTuple; 67 edge: HslTuple; 68 }; 69 glyphs: { 70 _: HslTuple; 71 _a: HslTuple; 72 _d: HslTuple; 73 _pl: HslTuple; 74 hl: HslTuple; 75 hl_a: HslTuple; 76 shade: HslTuple; 77 }; 78 } 79 80 export interface OsThemePreset { 81 ly0: ThemeLayer0; 82 ly1: ThemeLayer1; 83 ly2: ThemeLayer2; 84 } 85 86 export type ThemePreset = Record<ThemeMode, OsThemePreset>;