-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
99 lines (86 loc) · 2.75 KB
/
Copy pathtypes.ts
File metadata and controls
99 lines (86 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
export interface ColorToken {
hex: string;
name: string; // e.g., "Primary", "Background"
}
export interface ThemeTokens {
bg: string;
card: string;
card2: string;
text: string;
textMuted: string;
textOnColor: string; // Text color for use on colored backgrounds (primary, secondary, etc.)
primary: string;
primaryFg: string;
secondary: string;
secondaryFg: string;
accent: string;
accentFg: string;
border: string;
ring: string;
good: string;
goodFg: string;
warn: string;
warnFg: string;
bad: string;
badFg: string;
}
export interface DualTheme {
id: string;
timestamp: number;
light: ThemeTokens;
dark: ThemeTokens;
seed: string; // The base hue or hex used to generate
mode: GenerationMode;
}
export type GenerationMode = 'random' | 'monochrome' | 'analogous' | 'complementary' | 'split-complementary' | 'triadic' | 'tetradic' | 'compound' | 'triadic-split' | 'image';
export type ColorFormat = 'hex' | 'rgb' | 'cmyk' | 'hsl' | 'lab' | 'lch' | 'oklch' | 'display-p3';
export interface DesignOptions {
borderWidth: number; // 0 - 2 (none, thin, thick)
shadowStrength: number; // 0 - 5 (Size)
shadowOpacity: number; // 0 - 100 (%)
gradients: boolean; // Apply gradients to colored elements
radius: number; // 0 - 5
brightnessLevel: number; // -5 to 5, 0 is normal (shared when split is off)
contrastLevel: number; // -5 to 5, 0 is normal (shared when split is off)
saturationLevel: number; // -5 to 5, 0 is normal (shared when split is off)
darkFirst: boolean; // Generate dark mode first, derive light from dark
splitAdjustments: boolean; // When true, light/dark have independent B/C/S sliders
lightBrightnessLevel: number; // -5 to 5 (per-mode)
lightContrastLevel: number; // -5 to 5 (per-mode)
lightSaturationLevel: number; // -5 to 5 (per-mode)
darkBrightnessLevel: number; // -5 to 5 (per-mode)
darkContrastLevel: number; // -5 to 5 (per-mode)
darkSaturationLevel: number; // -5 to 5 (per-mode)
}
export type LockedColors = Partial<Record<keyof ThemeTokens, boolean>>;
export type LockedOptions = Partial<Record<keyof DesignOptions, boolean>>;
// --- OKLCH Palette Engine Types (v25.12.2) ---
export interface OklchColor {
L: number; // Lightness: 0-1
C: number; // Chroma: 0-0.4 (typical range)
H: number; // Hue: 0-360
}
export interface ColorScale {
50: string;
100: string;
200: string;
300: string;
400: string;
500: string;
600: string;
700: string;
800: string;
900: string;
}
export interface PaletteMetadata {
seed: string;
baseHue: number;
mode: GenerationMode;
score?: number;
timestamp: number;
}
export interface ExtendedTheme extends DualTheme {
metadata: PaletteMetadata;
neutralScale?: ColorScale;
primaryScale?: ColorScale;
}