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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
use std::sync::Arc;
use crate::{theme::DEFAULT_THEME_COLORS, ThemeMode};
use gpui::Hsla;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
/// Theme colors used throughout the UI components.
#[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, JsonSchema)]
pub struct ThemeColor {
/// Used for accents such as hover background on MenuItem, ListItem, etc.
pub accent: Hsla,
/// Used for accent text color.
pub accent_foreground: Hsla,
/// Accordion background color.
pub accordion: Hsla,
/// Accordion hover background color.
pub accordion_hover: Hsla,
/// Default background color.
pub background: Hsla,
/// Default border color
pub border: Hsla,
/// Background color for GroupBox.
pub group_box: Hsla,
/// Text color for GroupBox.
pub group_box_foreground: Hsla,
/// Input caret color (Blinking cursor).
pub caret: Hsla,
/// Chart 1 color.
pub chart_1: Hsla,
/// Chart 2 color.
pub chart_2: Hsla,
/// Chart 3 color.
pub chart_3: Hsla,
/// Chart 4 color.
pub chart_4: Hsla,
/// Chart 5 color.
pub chart_5: Hsla,
/// Danger background color.
pub danger: Hsla,
/// Danger active background color.
pub danger_active: Hsla,
/// Danger text color.
pub danger_foreground: Hsla,
/// Danger hover background color.
pub danger_hover: Hsla,
/// Description List label background color.
pub description_list_label: Hsla,
/// Description List label foreground color.
pub description_list_label_foreground: Hsla,
/// Drag border color.
pub drag_border: Hsla,
/// Drop target background color.
pub drop_target: Hsla,
/// Default text color.
pub foreground: Hsla,
/// Info background color.
pub info: Hsla,
/// Info active background color.
pub info_active: Hsla,
/// Info text color.
pub info_foreground: Hsla,
/// Info hover background color.
pub info_hover: Hsla,
/// Border color for inputs such as Input, Select, etc.
pub input: Hsla,
/// Link text color.
pub link: Hsla,
/// Active link text color.
pub link_active: Hsla,
/// Hover link text color.
pub link_hover: Hsla,
/// Background color for List and ListItem.
pub list: Hsla,
/// Background color for active ListItem.
pub list_active: Hsla,
/// Border color for active ListItem.
pub list_active_border: Hsla,
/// Stripe background color for even ListItem.
pub list_even: Hsla,
/// Background color for List header.
pub list_head: Hsla,
/// Hover background color for ListItem.
pub list_hover: Hsla,
/// Muted backgrounds such as Skeleton and Switch.
pub muted: Hsla,
/// Muted text color, as used in disabled text.
pub muted_foreground: Hsla,
/// Background color for Popover.
pub popover: Hsla,
/// Text color for Popover.
pub popover_foreground: Hsla,
/// Primary background color.
pub primary: Hsla,
/// Active primary background color.
pub primary_active: Hsla,
/// Primary text color.
pub primary_foreground: Hsla,
/// Hover primary background color.
pub primary_hover: Hsla,
/// Progress bar background color.
pub progress_bar: Hsla,
/// Used for focus ring.
pub ring: Hsla,
/// Scrollbar background color.
pub scrollbar: Hsla,
/// Scrollbar thumb background color.
pub scrollbar_thumb: Hsla,
/// Scrollbar thumb hover background color.
pub scrollbar_thumb_hover: Hsla,
/// Secondary background color.
pub secondary: Hsla,
/// Active secondary background color.
pub secondary_active: Hsla,
/// Secondary text color, used for secondary Button text color or secondary text.
pub secondary_foreground: Hsla,
/// Hover secondary background color.
pub secondary_hover: Hsla,
/// Input selection background color.
pub selection: Hsla,
/// Sidebar background color.
pub sidebar: Hsla,
/// Sidebar accent background color.
pub sidebar_accent: Hsla,
/// Sidebar accent text color.
pub sidebar_accent_foreground: Hsla,
/// Sidebar border color.
pub sidebar_border: Hsla,
/// Sidebar text color.
pub sidebar_foreground: Hsla,
/// Sidebar primary background color.
pub sidebar_primary: Hsla,
/// Sidebar primary text color.
pub sidebar_primary_foreground: Hsla,
/// Skeleton background color.
pub skeleton: Hsla,
/// Slider bar background color.
pub slider_bar: Hsla,
/// Slider thumb background color.
pub slider_thumb: Hsla,
/// Success background color.
pub success: Hsla,
/// Success text color.
pub success_foreground: Hsla,
/// Success hover background color.
pub success_hover: Hsla,
/// Success active background color.
pub success_active: Hsla,
/// Bullish color for candlestick charts (upward price movement).
pub bullish: Hsla,
/// Bearish color for candlestick charts (downward price movement).
pub bearish: Hsla,
/// Switch background color.
pub switch: Hsla,
/// Switch thumb background color.
pub switch_thumb: Hsla,
/// Tab background color.
pub tab: Hsla,
/// Tab active background color.
pub tab_active: Hsla,
/// Tab active text color.
pub tab_active_foreground: Hsla,
/// TabBar background color.
pub tab_bar: Hsla,
/// TabBar segmented background color.
pub tab_bar_segmented: Hsla,
/// Tab text color.
pub tab_foreground: Hsla,
/// Table background color.
pub table: Hsla,
/// Table active item background color.
pub table_active: Hsla,
/// Table active item border color.
pub table_active_border: Hsla,
/// Stripe background color for even TableRow.
pub table_even: Hsla,
/// Table head background color.
pub table_head: Hsla,
/// Table head text color.
pub table_head_foreground: Hsla,
/// Table item hover background color.
pub table_hover: Hsla,
/// Table row border color.
pub table_row_border: Hsla,
/// TitleBar background color, use for Window title bar.
pub title_bar: Hsla,
/// TitleBar border color.
pub title_bar_border: Hsla,
/// Background color for Tiles.
pub tiles: Hsla,
/// Warning background color.
pub warning: Hsla,
/// Warning active background color.
pub warning_active: Hsla,
/// Warning hover background color.
pub warning_hover: Hsla,
/// Warning foreground color.
pub warning_foreground: Hsla,
/// Overlay background color.
pub overlay: Hsla,
/// Window border color.
///
/// # Platform specific:
///
/// This is only works on Linux, other platforms we can't change the window border color.
pub window_border: Hsla,
/// The base red color.
pub red: Hsla,
/// The base red light color.
pub red_light: Hsla,
/// The base green color.
pub green: Hsla,
/// The base green light color.
pub green_light: Hsla,
/// The base blue color.
pub blue: Hsla,
/// The base blue light color.
pub blue_light: Hsla,
/// The base yellow color.
pub yellow: Hsla,
/// The base yellow light color.
pub yellow_light: Hsla,
/// The base magenta color.
pub magenta: Hsla,
/// The base magenta light color.
pub magenta_light: Hsla,
/// The base cyan color.
pub cyan: Hsla,
/// The base cyan light color.
pub cyan_light: Hsla,
}
impl ThemeColor {
/// Get the default light theme colors.
pub fn light() -> Arc<Self> {
DEFAULT_THEME_COLORS[&ThemeMode::Light].0.clone()
}
/// Get the default dark theme colors.
pub fn dark() -> Arc<Self> {
DEFAULT_THEME_COLORS[&ThemeMode::Dark].0.clone()
}
}