1use std::sync::Arc;
2
3use crate::{
4 AccentColors, Appearance, PlayerColor, PlayerColors, StatusColors, SyntaxTheme, SystemColors,
5 Theme, ThemeColors, ThemeFamily, ThemeStyles, try_parse_color,
6};
7use gpui::{HighlightStyle, Hsla, WindowBackgroundAppearance, hsla};
8
9pub const DEFAULT_DARK_THEME_NAME: &str = "One Dark";
10pub const DEFAULT_LIGHT_THEME_NAME: &str = "One Light";
11
12const ADDED_COLOR: Hsla = Hsla {
13 h: 142. / 360.,
14 s: 0.68,
15 l: 0.45,
16 a: 1.0,
17};
18const MODIFIED_COLOR: Hsla = Hsla {
19 h: 48. / 360.,
20 s: 0.76,
21 l: 0.47,
22 a: 1.0,
23};
24const REMOVED_COLOR: Hsla = Hsla {
25 h: 355. / 360.,
26 s: 0.65,
27 l: 0.65,
28 a: 1.0,
29};
30
31pub fn default_theme_family() -> ThemeFamily {
32 ThemeFamily {
33 id: "one".to_string(),
34 name: "One".into(),
35 author: "Zed Industries".into(),
36 themes: vec![default_dark_theme(), default_light_theme()],
37 }
38}
39
40pub fn default_dark_theme() -> Theme {
41 Theme {
42 id: "one-dark".to_string(),
43 name: "One Dark".into(),
44 appearance: Appearance::Dark,
45 styles: ThemeStyles {
46 window_background_appearance: WindowBackgroundAppearance::Opaque,
47 system: SystemColors::default(),
48 // todo!("put in actual accent colors")
49 accents: AccentColors(vec![
50 try_parse_color("#61afef").unwrap_or(hsla(0., 0., 0.15, 1.)),
51 ]),
52 colors: ThemeColors {
53 border: try_parse_color("#181a1f").unwrap_or(hsla(0., 0., 0.1, 1.)),
54 border_variant: try_parse_color("#181a1f").unwrap_or(hsla(0., 0., 0.1, 1.)),
55 border_focused: try_parse_color("#2e60bc").unwrap_or(hsla(0.6, 0.7, 0.5, 1.)),
56 border_selected: try_parse_color("#4370c4").unwrap_or(hsla(0.6, 0.6, 0.6, 1.)),
57 border_transparent: hsla(0., 0., 0., 0.),
58 border_disabled: try_parse_color("#242629").unwrap_or(hsla(0., 0., 0.15, 1.)),
59 elevated_surface_background: try_parse_color("#2c313a")
60 .unwrap_or(hsla(0., 0., 0.2, 1.)),
61 surface_background: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
62 background: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
63 element_background: try_parse_color("#2c313a").unwrap_or(hsla(0., 0., 0.2, 1.)),
64 element_hover: try_parse_color("#2c313a80").unwrap_or(hsla(0., 0., 0.2, 0.5)),
65 element_active: try_parse_color("#2c313a20").unwrap_or(hsla(0., 0., 0.2, 0.125)),
66 element_selected: try_parse_color("#2c313a").unwrap_or(hsla(0., 0., 0.2, 1.)),
67 element_selection_background: try_parse_color("#4370c43d")
68 .unwrap_or(hsla(0.6, 0.6, 0.6, 0.24)),
69 element_disabled: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
70 drop_target_background: try_parse_color("#FF00FF7F")
71 .unwrap_or(hsla(0.83, 1., 0.5, 0.5)),
72 ghost_element_background: hsla(0., 0., 0., 0.),
73 ghost_element_hover: try_parse_color("#2c313a80").unwrap_or(hsla(0., 0., 0.2, 0.5)),
74 ghost_element_active: try_parse_color("#2c313a20")
75 .unwrap_or(hsla(0., 0., 0.2, 0.125)),
76 ghost_element_selected: try_parse_color("#2c313a").unwrap_or(hsla(0., 0., 0.2, 1.)),
77 ghost_element_disabled: try_parse_color("#21252b")
78 .unwrap_or(hsla(0., 0., 0.15, 1.)),
79 text: try_parse_color("#aab2bf").unwrap_or(hsla(0., 0., 0.7, 1.)),
80 text_muted: try_parse_color("#5e6670").unwrap_or(hsla(0., 0., 0.4, 1.)),
81 text_placeholder: try_parse_color("#838994").unwrap_or(hsla(0., 0., 0.5, 1.)),
82 text_disabled: try_parse_color("#4c5360").unwrap_or(hsla(0., 0., 0.3, 1.)),
83 text_accent: try_parse_color("#5799e5").unwrap_or(hsla(0.6, 0.7, 0.6, 1.)),
84 icon: try_parse_color("#aab2bf").unwrap_or(hsla(0., 0., 0.7, 1.)),
85 icon_muted: try_parse_color("#5e6670").unwrap_or(hsla(0., 0., 0.4, 1.)),
86 icon_disabled: try_parse_color("#4c5360").unwrap_or(hsla(0., 0., 0.3, 1.)),
87 icon_placeholder: try_parse_color("#838994").unwrap_or(hsla(0., 0., 0.5, 1.)),
88 icon_accent: try_parse_color("#5799e5").unwrap_or(hsla(0.6, 0.7, 0.6, 1.)),
89 status_bar_background: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
90 title_bar_background: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
91 title_bar_inactive_background: try_parse_color("#282c34")
92 .unwrap_or(hsla(0., 0., 0.2, 1.)),
93 toolbar_background: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
94 tab_bar_background: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
95 tab_inactive_background: try_parse_color("#21252b")
96 .unwrap_or(hsla(0., 0., 0.15, 1.)),
97 tab_active_background: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
98 search_match_background: try_parse_color("#175fcc4d")
99 .unwrap_or(hsla(0.6, 0.8, 0.45, 0.3)),
100 panel_background: try_parse_color("#21252b").unwrap_or(hsla(0., 0., 0.15, 1.)),
101 panel_focused_border: try_parse_color("#2e60bc").unwrap_or(hsla(0.6, 0.7, 0.5, 1.)),
102 panel_indent_guide: try_parse_color("#2a2e36").unwrap_or(hsla(0., 0., 0.17, 1.)),
103 panel_indent_guide_hover: try_parse_color("#3a3f4b")
104 .unwrap_or(hsla(0., 0., 0.25, 1.)),
105 panel_indent_guide_active: try_parse_color("#4a515e")
106 .unwrap_or(hsla(0., 0., 0.32, 1.)),
107 pane_focused_border: try_parse_color("#2e60bc").unwrap_or(hsla(0.6, 0.7, 0.5, 1.)),
108 pane_group_border: try_parse_color("#181a1f").unwrap_or(hsla(0., 0., 0.1, 1.)),
109 scrollbar_thumb_background: try_parse_color("#F000F03d")
110 .unwrap_or(hsla(0., 1., 0.47, 0.24)),
111 scrollbar_thumb_hover_background: try_parse_color("#F000F052")
112 .unwrap_or(hsla(0., 1., 0.47, 0.32)),
113 scrollbar_thumb_active_background: try_parse_color("#F000F075")
114 .unwrap_or(hsla(0., 1., 0.47, 0.46)),
115 scrollbar_thumb_border: try_parse_color("#2a2e36")
116 .unwrap_or(hsla(0., 0., 0.17, 1.)),
117 scrollbar_track_background: hsla(0., 0., 0., 0.),
118 scrollbar_track_border: try_parse_color("#2a2d38")
119 .unwrap_or(hsla(0., 0., 0.18, 1.)),
120 minimap_thumb_background: try_parse_color("#4c526333")
121 .unwrap_or(hsla(0., 0., 0.35, 0.2)),
122 minimap_thumb_hover_background: try_parse_color("#4c52634d")
123 .unwrap_or(hsla(0., 0., 0.35, 0.3)),
124 minimap_thumb_active_background: try_parse_color("#4c526366")
125 .unwrap_or(hsla(0., 0., 0.35, 0.4)),
126 minimap_thumb_border: try_parse_color("#2a2d38").unwrap_or(hsla(0., 0., 0.18, 1.)),
127 editor_foreground: try_parse_color("#abb2bf").unwrap_or(hsla(0., 0., 0.7, 1.)),
128 editor_background: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
129 editor_gutter_background: try_parse_color("#282c34")
130 .unwrap_or(hsla(0., 0., 0.2, 1.)),
131 editor_subheader_background: try_parse_color("#21252b")
132 .unwrap_or(hsla(0., 0., 0.15, 1.)),
133 editor_active_line_background: try_parse_color("#F0F0F00a")
134 .unwrap_or(hsla(0., 0., 0.94, 0.04)),
135 editor_highlighted_line_background: try_parse_color("#F0F0F00f")
136 .unwrap_or(hsla(0., 0., 0.94, 0.06)),
137 editor_debugger_active_line_background: try_parse_color("#7e6cca52")
138 .unwrap_or(hsla(0.71, 0.4, 0.6, 0.32)),
139 editor_line_number: try_parse_color("#636b78").unwrap_or(hsla(0., 0., 0.42, 1.)),
140 editor_active_line_number: try_parse_color("#abb2bf")
141 .unwrap_or(hsla(0., 0., 0.7, 1.)),
142 editor_hover_line_number: try_parse_color("#abb2bf")
143 .unwrap_or(hsla(0., 0., 0.7, 1.)),
144 editor_invisible: try_parse_color("#5e6670").unwrap_or(hsla(0., 0., 0.4, 1.)),
145 editor_wrap_guide: try_parse_color("#2a2e36").unwrap_or(hsla(0., 0., 0.17, 1.)),
146 editor_active_wrap_guide: try_parse_color("#3a3f4b")
147 .unwrap_or(hsla(0., 0., 0.25, 1.)),
148 editor_indent_guide: try_parse_color("#2a2e36").unwrap_or(hsla(0., 0., 0.17, 1.)),
149 editor_indent_guide_active: try_parse_color("#3a3f4b")
150 .unwrap_or(hsla(0., 0., 0.25, 1.)),
151 editor_document_highlight_read_background: try_parse_color("#4370c40f")
152 .unwrap_or(hsla(0.6, 0.6, 0.6, 0.06)),
153 editor_document_highlight_write_background: try_parse_color("#4370c466")
154 .unwrap_or(hsla(0.6, 0.6, 0.6, 0.4)),
155 terminal_background: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
156 terminal_foreground: try_parse_color("#abb2bf").unwrap_or(hsla(0., 0., 0.7, 1.)),
157 terminal_bright_foreground: try_parse_color("#c8ccd4")
158 .unwrap_or(hsla(0., 0., 0.8, 1.)),
159 terminal_dim_foreground: try_parse_color("#5f697a")
160 .unwrap_or(hsla(0., 0., 0.4, 1.)),
161 terminal_ansi_black: try_parse_color("#282c34").unwrap_or(hsla(0., 0., 0.2, 1.)),
162 terminal_ansi_bright_black: try_parse_color("#3f4451")
163 .unwrap_or(hsla(0., 0., 0.27, 1.)),
164 terminal_ansi_dim_black: try_parse_color("#5f697a")
165 .unwrap_or(hsla(0., 0., 0.4, 1.)),
166 terminal_ansi_red: try_parse_color("#e06c75").unwrap_or(hsla(0.97, 0.65, 0.65, 1.)),
167 terminal_ansi_bright_red: try_parse_color("#d07277")
168 .unwrap_or(hsla(0.97, 0.55, 0.65, 1.)),
169 terminal_ansi_dim_red: try_parse_color("#c45660")
170 .unwrap_or(hsla(0.97, 0.5, 0.57, 1.)),
171 terminal_ansi_green: try_parse_color("#98c379").unwrap_or(hsla(0.3, 0.4, 0.6, 1.)),
172 terminal_ansi_bright_green: try_parse_color("#a9d88d")
173 .unwrap_or(hsla(0.3, 0.5, 0.7, 1.)),
174 terminal_ansi_dim_green: try_parse_color("#76a85d")
175 .unwrap_or(hsla(0.3, 0.3, 0.5, 1.)),
176 terminal_ansi_yellow: try_parse_color("#e5c07b")
177 .unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
178 terminal_ansi_bright_yellow: try_parse_color("#f0d197")
179 .unwrap_or(hsla(0.11, 0.7, 0.77, 1.)),
180 terminal_ansi_dim_yellow: try_parse_color("#d7a55f")
181 .unwrap_or(hsla(0.11, 0.6, 0.6, 1.)),
182 terminal_ansi_blue: try_parse_color("#61afef")
183 .unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
184 terminal_ansi_bright_blue: try_parse_color("#6cb3ff")
185 .unwrap_or(hsla(0.58, 1., 0.71, 1.)),
186 terminal_ansi_dim_blue: try_parse_color("#3d8fd4")
187 .unwrap_or(hsla(0.58, 0.7, 0.54, 1.)),
188 terminal_ansi_magenta: try_parse_color("#c678dd")
189 .unwrap_or(hsla(0.78, 0.6, 0.69, 1.)),
190 terminal_ansi_bright_magenta: try_parse_color("#ca82e5")
191 .unwrap_or(hsla(0.78, 0.7, 0.7, 1.)),
192 terminal_ansi_dim_magenta: try_parse_color("#a65cc8")
193 .unwrap_or(hsla(0.78, 0.5, 0.6, 1.)),
194 terminal_ansi_cyan: try_parse_color("#56b6c2").unwrap_or(hsla(0.53, 0.5, 0.56, 1.)),
195 terminal_ansi_bright_cyan: try_parse_color("#64c5d3")
196 .unwrap_or(hsla(0.53, 0.6, 0.61, 1.)),
197 terminal_ansi_dim_cyan: try_parse_color("#4096a1")
198 .unwrap_or(hsla(0.53, 0.42, 0.44, 1.)),
199 terminal_ansi_white: try_parse_color("#dcdfe4").unwrap_or(hsla(0., 0., 0.87, 1.)),
200 terminal_ansi_bright_white: try_parse_color("#f0f0f0")
201 .unwrap_or(hsla(0., 0., 0.94, 1.)),
202 terminal_ansi_dim_white: try_parse_color("#abb2bf")
203 .unwrap_or(hsla(0., 0., 0.7, 1.)),
204 link_text_hover: try_parse_color("#5799e5").unwrap_or(hsla(0.6, 0.7, 0.6, 1.)),
205 version_control_added: ADDED_COLOR,
206 version_control_modified: MODIFIED_COLOR,
207 version_control_deleted: REMOVED_COLOR,
208 version_control_conflict_marker_ours: try_parse_color("#98c379")
209 .unwrap_or(hsla(0.3, 0.4, 0.6, 1.)),
210 version_control_conflict_marker_theirs: try_parse_color("#61afef")
211 .unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
212 debugger_accent: try_parse_color("#c678dd").unwrap_or(hsla(0.78, 0.6, 0.69, 1.)),
213 editor_document_highlight_bracket_background: try_parse_color("#4370c419")
214 .unwrap_or(hsla(0.6, 0.6, 0.6, 0.1)),
215 terminal_ansi_background: try_parse_color("#282c34")
216 .unwrap_or(hsla(0., 0., 0.2, 1.)),
217 version_control_renamed: try_parse_color("#61afef")
218 .unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
219 version_control_conflict: try_parse_color("#e5c07b")
220 .unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
221 version_control_ignored: try_parse_color("#5e6670")
222 .unwrap_or(hsla(0., 0., 0.4, 1.)),
223 },
224 status: StatusColors {
225 conflict: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
226 conflict_background: try_parse_color("#332412")
227 .unwrap_or(hsla(0.11, 0.5, 0.14, 1.)),
228 conflict_border: try_parse_color("#5d4224").unwrap_or(hsla(0.11, 0.5, 0.25, 1.)),
229 created: try_parse_color("#98c379").unwrap_or(hsla(0.3, 0.4, 0.6, 1.)),
230 created_background: try_parse_color("#252d1f").unwrap_or(hsla(0.3, 0.2, 0.15, 1.)),
231 created_border: try_parse_color("#436330").unwrap_or(hsla(0.3, 0.35, 0.3, 1.)),
232 deleted: try_parse_color("#e06c75").unwrap_or(hsla(0.97, 0.65, 0.65, 1.)),
233 deleted_background: try_parse_color("#301c1e")
234 .unwrap_or(hsla(0.97, 0.25, 0.15, 1.)),
235 deleted_border: try_parse_color("#5e3135").unwrap_or(hsla(0.97, 0.3, 0.28, 1.)),
236 error: try_parse_color("#e06c75").unwrap_or(hsla(0.97, 0.65, 0.65, 1.)),
237 error_background: try_parse_color("#301c1e").unwrap_or(hsla(0.97, 0.25, 0.15, 1.)),
238 error_border: try_parse_color("#5e3135").unwrap_or(hsla(0.97, 0.3, 0.28, 1.)),
239 hidden: try_parse_color("#838994").unwrap_or(hsla(0., 0., 0.5, 1.)),
240 hidden_background: try_parse_color("#23252a").unwrap_or(hsla(0., 0., 0.15, 1.)),
241 hidden_border: try_parse_color("#3f4248").unwrap_or(hsla(0., 0., 0.26, 1.)),
242 hint: try_parse_color("#969dad").unwrap_or(hsla(0., 0., 0.6, 1.)),
243 hint_background: try_parse_color("#212843").unwrap_or(hsla(0.64, 0.34, 0.2, 1.)),
244 hint_border: try_parse_color("#3d4466").unwrap_or(hsla(0.64, 0.24, 0.32, 1.)),
245 ignored: try_parse_color("#838994").unwrap_or(hsla(0., 0., 0.5, 1.)),
246 ignored_background: try_parse_color("#23252a").unwrap_or(hsla(0., 0., 0.15, 1.)),
247 ignored_border: try_parse_color("#3f4248").unwrap_or(hsla(0., 0., 0.26, 1.)),
248 info: try_parse_color("#61afef").unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
249 info_background: try_parse_color("#1a2939").unwrap_or(hsla(0.58, 0.35, 0.17, 1.)),
250 info_border: try_parse_color("#274d75").unwrap_or(hsla(0.58, 0.5, 0.31, 1.)),
251 modified: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
252 modified_background: try_parse_color("#332412")
253 .unwrap_or(hsla(0.11, 0.5, 0.14, 1.)),
254 modified_border: try_parse_color("#5d4224").unwrap_or(hsla(0.11, 0.5, 0.25, 1.)),
255 predictive: try_parse_color("#808491").unwrap_or(hsla(0., 0., 0.55, 1.)),
256 predictive_background: try_parse_color("#222326").unwrap_or(hsla(0., 0., 0.14, 1.)),
257 predictive_border: try_parse_color("#3c3e45").unwrap_or(hsla(0., 0., 0.26, 1.)),
258 renamed: try_parse_color("#61afef").unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
259 renamed_background: try_parse_color("#1a2939")
260 .unwrap_or(hsla(0.58, 0.35, 0.17, 1.)),
261 renamed_border: try_parse_color("#274d75").unwrap_or(hsla(0.58, 0.5, 0.31, 1.)),
262 success: try_parse_color("#98c379").unwrap_or(hsla(0.3, 0.4, 0.6, 1.)),
263 success_background: try_parse_color("#252d1f").unwrap_or(hsla(0.3, 0.2, 0.15, 1.)),
264 success_border: try_parse_color("#436330").unwrap_or(hsla(0.3, 0.35, 0.3, 1.)),
265 unreachable: try_parse_color("#838994").unwrap_or(hsla(0., 0., 0.5, 1.)),
266 unreachable_background: try_parse_color("#23252a")
267 .unwrap_or(hsla(0., 0., 0.15, 1.)),
268 unreachable_border: try_parse_color("#3f4248").unwrap_or(hsla(0., 0., 0.26, 1.)),
269 warning: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
270 warning_background: try_parse_color("#332412").unwrap_or(hsla(0.11, 0.5, 0.14, 1.)),
271 warning_border: try_parse_color("#5d4224").unwrap_or(hsla(0.11, 0.5, 0.25, 1.)),
272 },
273 player: PlayerColors(vec![
274 PlayerColor {
275 cursor: try_parse_color("#61afef").unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
276 background: try_parse_color("#61afef").unwrap_or(hsla(0.58, 0.81, 0.68, 1.)),
277 selection: try_parse_color("#61afef3d").unwrap_or(hsla(0.58, 0.81, 0.68, 0.24)),
278 },
279 PlayerColor {
280 cursor: try_parse_color("#a86fe8").unwrap_or(hsla(0.75, 0.75, 0.68, 1.)),
281 background: try_parse_color("#a86fe8").unwrap_or(hsla(0.75, 0.75, 0.68, 1.)),
282 selection: try_parse_color("#a86fe83d").unwrap_or(hsla(0.75, 0.75, 0.68, 0.24)),
283 },
284 PlayerColor {
285 cursor: try_parse_color("#50d699").unwrap_or(hsla(0.42, 0.6, 0.59, 1.)),
286 background: try_parse_color("#50d699").unwrap_or(hsla(0.42, 0.6, 0.59, 1.)),
287 selection: try_parse_color("#50d6993d").unwrap_or(hsla(0.42, 0.6, 0.59, 0.24)),
288 },
289 PlayerColor {
290 cursor: try_parse_color("#f35955").unwrap_or(hsla(0.005, 0.87, 0.65, 1.)),
291 background: try_parse_color("#f35955").unwrap_or(hsla(0.005, 0.87, 0.65, 1.)),
292 selection: try_parse_color("#f359553d")
293 .unwrap_or(hsla(0.005, 0.87, 0.65, 0.24)),
294 },
295 PlayerColor {
296 cursor: try_parse_color("#fe9934").unwrap_or(hsla(0.08, 0.99, 0.6, 1.)),
297 background: try_parse_color("#fe9934").unwrap_or(hsla(0.08, 0.99, 0.6, 1.)),
298 selection: try_parse_color("#fe99343d").unwrap_or(hsla(0.08, 0.99, 0.6, 0.24)),
299 },
300 PlayerColor {
301 cursor: try_parse_color("#ff69b4").unwrap_or(hsla(0.92, 1., 0.71, 1.)),
302 background: try_parse_color("#ff69b4").unwrap_or(hsla(0.92, 1., 0.71, 1.)),
303 selection: try_parse_color("#ff69b43d").unwrap_or(hsla(0.92, 1., 0.71, 0.24)),
304 },
305 PlayerColor {
306 cursor: try_parse_color("#00bfff").unwrap_or(hsla(0.55, 1., 0.5, 1.)),
307 background: try_parse_color("#00bfff").unwrap_or(hsla(0.55, 1., 0.5, 1.)),
308 selection: try_parse_color("#00bfff3d").unwrap_or(hsla(0.55, 1., 0.5, 0.24)),
309 },
310 PlayerColor {
311 cursor: try_parse_color("#00ff00").unwrap_or(hsla(0.33, 1., 0.5, 1.)),
312 background: try_parse_color("#00ff00").unwrap_or(hsla(0.33, 1., 0.5, 1.)),
313 selection: try_parse_color("#00ff003d").unwrap_or(hsla(0.33, 1., 0.5, 0.24)),
314 },
315 ]),
316 syntax: Arc::new(SyntaxTheme {
317 highlights: vec![
318 (
319 "attribute".to_string(),
320 HighlightStyle {
321 color: try_parse_color("#e5c07b")
322 .map(Some)
323 .unwrap_or(Some(hsla(0.11, 0.67, 0.67, 1.))),
324 font_style: None,
325 font_weight: None,
326 ..Default::default()
327 },
328 ),
329 (
330 "boolean".to_string(),
331 HighlightStyle {
332 color: try_parse_color("#d19a66")
333 .map(Some)
334 .unwrap_or(Some(hsla(0.08, 0.45, 0.61, 1.))),
335 font_style: None,
336 font_weight: None,
337 ..Default::default()
338 },
339 ),
340 (
341 "comment".to_string(),
342 HighlightStyle {
343 color: try_parse_color("#6f7380")
344 .map(Some)
345 .unwrap_or(Some(hsla(0., 0., 0.45, 1.))),
346 font_style: Some(gpui::FontStyle::Italic),
347 font_weight: None,
348 ..Default::default()
349 },
350 ),
351 (
352 "comment.doc".to_string(),
353 HighlightStyle {
354 color: try_parse_color("#848896")
355 .map(Some)
356 .unwrap_or(Some(hsla(0., 0., 0.53, 1.))),
357 font_style: Some(gpui::FontStyle::Italic),
358 font_weight: None,
359 ..Default::default()
360 },
361 ),
362 (
363 "constant".to_string(),
364 HighlightStyle {
365 color: try_parse_color("#d19a66")
366 .map(Some)
367 .unwrap_or(Some(hsla(0.08, 0.45, 0.61, 1.))),
368 font_style: None,
369 font_weight: None,
370 ..Default::default()
371 },
372 ),
373 (
374 "constructor".to_string(),
375 HighlightStyle {
376 color: try_parse_color("#61afef")
377 .map(Some)
378 .unwrap_or(Some(hsla(0.58, 0.81, 0.68, 1.))),
379 font_style: None,
380 font_weight: None,
381 ..Default::default()
382 },
383 ),
384 (
385 "emphasis".to_string(),
386 HighlightStyle {
387 color: try_parse_color("#5799e5")
388 .map(Some)
389 .unwrap_or(Some(hsla(0.6, 0.7, 0.6, 1.))),
390 font_style: Some(gpui::FontStyle::Italic),
391 font_weight: None,
392 ..Default::default()
393 },
394 ),
395 (
396 "emphasis.strong".to_string(),
397 HighlightStyle {
398 color: try_parse_color("#5799e5")
399 .map(Some)
400 .unwrap_or(Some(hsla(0.6, 0.7, 0.6, 1.))),
401 font_style: None,
402 font_weight: Some(gpui::FontWeight::BOLD),
403 ..Default::default()
404 },
405 ),
406 (
407 "function".to_string(),
408 HighlightStyle {
409 color: try_parse_color("#61afef")
410 .map(Some)
411 .unwrap_or(Some(hsla(0.58, 0.81, 0.68, 1.))),
412 font_style: None,
413 font_weight: None,
414 ..Default::default()
415 },
416 ),
417 (
418 "keyword".to_string(),
419 HighlightStyle {
420 color: try_parse_color("#c678dd")
421 .map(Some)
422 .unwrap_or(Some(hsla(0.78, 0.6, 0.69, 1.))),
423 font_style: None,
424 font_weight: None,
425 ..Default::default()
426 },
427 ),
428 (
429 "label".to_string(),
430 HighlightStyle {
431 color: try_parse_color("#61afef")
432 .map(Some)
433 .unwrap_or(Some(hsla(0.58, 0.81, 0.68, 1.))),
434 font_style: None,
435 font_weight: None,
436 ..Default::default()
437 },
438 ),
439 (
440 "link_text".to_string(),
441 HighlightStyle {
442 color: try_parse_color("#93c1e8")
443 .map(Some)
444 .unwrap_or(Some(hsla(0.58, 0.65, 0.74, 1.))),
445 font_style: None,
446 font_weight: None,
447 ..Default::default()
448 },
449 ),
450 (
451 "link_uri".to_string(),
452 HighlightStyle {
453 color: try_parse_color("#56b6c2")
454 .map(Some)
455 .unwrap_or(Some(hsla(0.53, 0.5, 0.56, 1.))),
456 font_style: None,
457 font_weight: None,
458 ..Default::default()
459 },
460 ),
461 (
462 "number".to_string(),
463 HighlightStyle {
464 color: try_parse_color("#d19a66")
465 .map(Some)
466 .unwrap_or(Some(hsla(0.08, 0.45, 0.61, 1.))),
467 font_style: None,
468 font_weight: None,
469 ..Default::default()
470 },
471 ),
472 (
473 "operator".to_string(),
474 HighlightStyle {
475 color: try_parse_color("#56b6c2")
476 .map(Some)
477 .unwrap_or(Some(hsla(0.53, 0.5, 0.56, 1.))),
478 font_style: None,
479 font_weight: None,
480 ..Default::default()
481 },
482 ),
483 (
484 "preproc".to_string(),
485 HighlightStyle {
486 color: try_parse_color("#c678dd")
487 .map(Some)
488 .unwrap_or(Some(hsla(0.78, 0.6, 0.69, 1.))),
489 font_style: None,
490 font_weight: None,
491 ..Default::default()
492 },
493 ),
494 (
495 "property".to_string(),
496 HighlightStyle {
497 color: try_parse_color("#e06c75")
498 .map(Some)
499 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
500 font_style: None,
501 font_weight: None,
502 ..Default::default()
503 },
504 ),
505 (
506 "punctuation".to_string(),
507 HighlightStyle {
508 color: try_parse_color("#abb2bf")
509 .map(Some)
510 .unwrap_or(Some(hsla(0., 0., 0.7, 1.))),
511 font_style: None,
512 font_weight: None,
513 ..Default::default()
514 },
515 ),
516 (
517 "punctuation.bracket".to_string(),
518 HighlightStyle {
519 color: try_parse_color("#abb2bf")
520 .map(Some)
521 .unwrap_or(Some(hsla(0., 0., 0.7, 1.))),
522 font_style: None,
523 font_weight: None,
524 ..Default::default()
525 },
526 ),
527 (
528 "punctuation.delimiter".to_string(),
529 HighlightStyle {
530 color: try_parse_color("#abb2bf")
531 .map(Some)
532 .unwrap_or(Some(hsla(0., 0., 0.7, 1.))),
533 font_style: None,
534 font_weight: None,
535 ..Default::default()
536 },
537 ),
538 (
539 "punctuation.list_marker".to_string(),
540 HighlightStyle {
541 color: try_parse_color("#e06c75")
542 .map(Some)
543 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
544 font_style: None,
545 font_weight: None,
546 ..Default::default()
547 },
548 ),
549 (
550 "punctuation.special".to_string(),
551 HighlightStyle {
552 color: try_parse_color("#e06c75")
553 .map(Some)
554 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
555 font_style: None,
556 font_weight: None,
557 ..Default::default()
558 },
559 ),
560 (
561 "string".to_string(),
562 HighlightStyle {
563 color: try_parse_color("#98c379")
564 .map(Some)
565 .unwrap_or(Some(hsla(0.3, 0.4, 0.6, 1.))),
566 font_style: None,
567 font_weight: None,
568 ..Default::default()
569 },
570 ),
571 (
572 "string.escape".to_string(),
573 HighlightStyle {
574 color: try_parse_color("#56b6c2")
575 .map(Some)
576 .unwrap_or(Some(hsla(0.53, 0.5, 0.56, 1.))),
577 font_style: None,
578 font_weight: None,
579 ..Default::default()
580 },
581 ),
582 (
583 "string.regex".to_string(),
584 HighlightStyle {
585 color: try_parse_color("#e06c75")
586 .map(Some)
587 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
588 font_style: None,
589 font_weight: None,
590 ..Default::default()
591 },
592 ),
593 (
594 "string.special".to_string(),
595 HighlightStyle {
596 color: try_parse_color("#e06c75")
597 .map(Some)
598 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
599 font_style: None,
600 font_weight: None,
601 ..Default::default()
602 },
603 ),
604 (
605 "string.special.symbol".to_string(),
606 HighlightStyle {
607 color: try_parse_color("#98c379")
608 .map(Some)
609 .unwrap_or(Some(hsla(0.3, 0.4, 0.6, 1.))),
610 font_style: None,
611 font_weight: None,
612 ..Default::default()
613 },
614 ),
615 (
616 "tag".to_string(),
617 HighlightStyle {
618 color: try_parse_color("#e06c75")
619 .map(Some)
620 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
621 font_style: None,
622 font_weight: None,
623 ..Default::default()
624 },
625 ),
626 (
627 "text.literal".to_string(),
628 HighlightStyle {
629 color: try_parse_color("#98c379")
630 .map(Some)
631 .unwrap_or(Some(hsla(0.3, 0.4, 0.6, 1.))),
632 font_style: None,
633 font_weight: None,
634 ..Default::default()
635 },
636 ),
637 (
638 "title".to_string(),
639 HighlightStyle {
640 color: try_parse_color("#61afef")
641 .map(Some)
642 .unwrap_or(Some(hsla(0.58, 0.81, 0.68, 1.))),
643 font_style: None,
644 font_weight: Some(gpui::FontWeight::BOLD),
645 ..Default::default()
646 },
647 ),
648 (
649 "type".to_string(),
650 HighlightStyle {
651 color: try_parse_color("#e5c07b")
652 .map(Some)
653 .unwrap_or(Some(hsla(0.11, 0.67, 0.67, 1.))),
654 font_style: None,
655 font_weight: None,
656 ..Default::default()
657 },
658 ),
659 (
660 "variable".to_string(),
661 HighlightStyle {
662 color: try_parse_color("#e06c75")
663 .map(Some)
664 .unwrap_or(Some(hsla(0.97, 0.65, 0.65, 1.))),
665 font_style: None,
666 font_weight: None,
667 ..Default::default()
668 },
669 ),
670 (
671 "variable.special".to_string(),
672 HighlightStyle {
673 color: try_parse_color("#c678dd")
674 .map(Some)
675 .unwrap_or(Some(hsla(0.78, 0.6, 0.69, 1.))),
676 font_style: None,
677 font_weight: None,
678 ..Default::default()
679 },
680 ),
681 (
682 "variant".to_string(),
683 HighlightStyle {
684 color: try_parse_color("#61afef")
685 .map(Some)
686 .unwrap_or(Some(hsla(0.58, 0.81, 0.68, 1.))),
687 font_style: None,
688 font_weight: None,
689 ..Default::default()
690 },
691 ),
692 ],
693 }),
694 },
695 }
696}
697
698pub fn default_light_theme() -> Theme {
699 Theme {
700 id: "one-light".to_string(),
701 name: "One Light".into(),
702 appearance: Appearance::Light,
703 styles: ThemeStyles {
704 window_background_appearance: WindowBackgroundAppearance::Opaque,
705 system: SystemColors::default(),
706 // todo! fill out correct colors
707 accents: AccentColors(vec![try_parse_color("red").unwrap_or(hsla(0., 0., 0., 0.))]),
708 colors: ThemeColors {
709 border: try_parse_color("#d9dce0").unwrap_or(hsla(0., 0., 0.86, 1.)),
710 border_variant: try_parse_color("#d9dce0").unwrap_or(hsla(0., 0., 0.86, 1.)),
711 border_focused: try_parse_color("#2188ff").unwrap_or(hsla(0.58, 1., 0.57, 1.)),
712 border_selected: try_parse_color("#4198ff").unwrap_or(hsla(0.58, 1., 0.63, 1.)),
713 border_transparent: hsla(0., 0., 0., 0.),
714 border_disabled: try_parse_color("#c9cbd1").unwrap_or(hsla(0., 0., 0.79, 1.)),
715 elevated_surface_background: try_parse_color("#e0e1e6")
716 .unwrap_or(hsla(0., 0., 0.88, 1.)),
717 surface_background: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
718 background: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
719 element_background: try_parse_color("#e0e1e6").unwrap_or(hsla(0., 0., 0.88, 1.)),
720 element_hover: try_parse_color("#e0e1e680").unwrap_or(hsla(0., 0., 0.88, 0.5)),
721 element_active: try_parse_color("#e0e1e620").unwrap_or(hsla(0., 0., 0.88, 0.125)),
722 element_selected: try_parse_color("#e0e1e6").unwrap_or(hsla(0., 0., 0.88, 1.)),
723 element_selection_background: try_parse_color("#4198ff3d")
724 .unwrap_or(hsla(0.58, 1., 0.63, 0.24)),
725 element_disabled: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
726 drop_target_background: try_parse_color("#FF00FF7F")
727 .unwrap_or(hsla(0.83, 1., 0.5, 0.5)),
728 ghost_element_background: hsla(0., 0., 0., 0.),
729 ghost_element_hover: try_parse_color("#e0e1e680")
730 .unwrap_or(hsla(0., 0., 0.88, 0.5)),
731 ghost_element_active: try_parse_color("#e0e1e620")
732 .unwrap_or(hsla(0., 0., 0.88, 0.125)),
733 ghost_element_selected: try_parse_color("#e0e1e6")
734 .unwrap_or(hsla(0., 0., 0.88, 1.)),
735 ghost_element_disabled: try_parse_color("#f0f0f1")
736 .unwrap_or(hsla(0., 0., 0.94, 1.)),
737 text: try_parse_color("#383a42").unwrap_or(hsla(0., 0., 0.24, 1.)),
738 text_muted: try_parse_color("#a2a3a7").unwrap_or(hsla(0., 0., 0.64, 1.)),
739 text_placeholder: try_parse_color("#898b92").unwrap_or(hsla(0., 0., 0.55, 1.)),
740 text_disabled: try_parse_color("#a8abb3").unwrap_or(hsla(0., 0., 0.67, 1.)),
741 text_accent: try_parse_color("#0d74f0").unwrap_or(hsla(0.58, 0.9, 0.5, 1.)),
742 icon: try_parse_color("#383a42").unwrap_or(hsla(0., 0., 0.24, 1.)),
743 icon_muted: try_parse_color("#7f848e").unwrap_or(hsla(0., 0., 0.52, 1.)),
744 icon_disabled: try_parse_color("#a8abb3").unwrap_or(hsla(0., 0., 0.67, 1.)),
745 icon_placeholder: try_parse_color("#898b92").unwrap_or(hsla(0., 0., 0.55, 1.)),
746 icon_accent: try_parse_color("#0d74f0").unwrap_or(hsla(0.58, 0.9, 0.5, 1.)),
747 status_bar_background: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
748 title_bar_background: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
749 title_bar_inactive_background: try_parse_color("#fafafa")
750 .unwrap_or(hsla(0., 0., 0.98, 1.)),
751 toolbar_background: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
752 tab_bar_background: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
753 tab_inactive_background: try_parse_color("#f0f0f1")
754 .unwrap_or(hsla(0., 0., 0.94, 1.)),
755 tab_active_background: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
756 search_match_background: try_parse_color("#175fcc4d")
757 .unwrap_or(hsla(0.58, 0.8, 0.45, 0.3)),
758 panel_background: try_parse_color("#f0f0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
759 panel_focused_border: try_parse_color("#2188ff")
760 .unwrap_or(hsla(0.58, 1., 0.57, 1.)),
761 panel_indent_guide: try_parse_color("#e0e1e6").unwrap_or(hsla(0., 0., 0.88, 1.)),
762 panel_indent_guide_hover: try_parse_color("#c9cbd1")
763 .unwrap_or(hsla(0., 0., 0.79, 1.)),
764 panel_indent_guide_active: try_parse_color("#b2b5bd")
765 .unwrap_or(hsla(0., 0., 0.71, 1.)),
766 pane_focused_border: try_parse_color("#2188ff").unwrap_or(hsla(0.58, 1., 0.57, 1.)),
767 pane_group_border: try_parse_color("#d9dce0").unwrap_or(hsla(0., 0., 0.86, 1.)),
768 scrollbar_thumb_background: try_parse_color("#F000F03d")
769 .unwrap_or(hsla(0., 1., 0.47, 0.24)),
770 scrollbar_thumb_hover_background: try_parse_color("#F000F052")
771 .unwrap_or(hsla(0., 1., 0.47, 0.32)),
772 scrollbar_thumb_active_background: try_parse_color("#F000F075")
773 .unwrap_or(hsla(0., 1., 0.47, 0.46)),
774 scrollbar_thumb_border: try_parse_color("#e0e1e6")
775 .unwrap_or(hsla(0., 0., 0.88, 1.)),
776 scrollbar_track_background: hsla(0., 0., 0., 0.),
777 scrollbar_track_border: try_parse_color("#eff0f1")
778 .unwrap_or(hsla(0., 0., 0.94, 1.)),
779 minimap_thumb_background: try_parse_color("#b2b5bd33")
780 .unwrap_or(hsla(0., 0., 0.71, 0.2)),
781 minimap_thumb_hover_background: try_parse_color("#b2b5bd4d")
782 .unwrap_or(hsla(0., 0., 0.71, 0.3)),
783 minimap_thumb_active_background: try_parse_color("#b2b5bd66")
784 .unwrap_or(hsla(0., 0., 0.71, 0.4)),
785 minimap_thumb_border: try_parse_color("#eff0f1").unwrap_or(hsla(0., 0., 0.94, 1.)),
786 editor_foreground: try_parse_color("#383a42").unwrap_or(hsla(0., 0., 0.24, 1.)),
787 editor_background: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
788 editor_gutter_background: try_parse_color("#fafafa")
789 .unwrap_or(hsla(0., 0., 0.98, 1.)),
790 editor_subheader_background: try_parse_color("#f0f0f1")
791 .unwrap_or(hsla(0., 0., 0.94, 1.)),
792 editor_active_line_background: try_parse_color("#F0F0F00a")
793 .unwrap_or(hsla(0., 0., 0.94, 0.04)),
794 editor_highlighted_line_background: try_parse_color("#F0F0F00f")
795 .unwrap_or(hsla(0., 0., 0.94, 0.06)),
796 editor_debugger_active_line_background: try_parse_color("#7e6cca52")
797 .unwrap_or(hsla(0.71, 0.4, 0.6, 0.32)),
798 editor_line_number: try_parse_color("#9fa2a6").unwrap_or(hsla(0., 0., 0.63, 1.)),
799 editor_active_line_number: try_parse_color("#383a42")
800 .unwrap_or(hsla(0., 0., 0.24, 1.)),
801 editor_hover_line_number: try_parse_color("#383a42")
802 .unwrap_or(hsla(0., 0., 0.24, 1.)),
803 editor_invisible: try_parse_color("#a2a3a7").unwrap_or(hsla(0., 0., 0.64, 1.)),
804 editor_wrap_guide: try_parse_color("#e0e1e6").unwrap_or(hsla(0., 0., 0.88, 1.)),
805 editor_active_wrap_guide: try_parse_color("#c9cbd1")
806 .unwrap_or(hsla(0., 0., 0.79, 1.)),
807 editor_indent_guide: try_parse_color("#e0e1e6").unwrap_or(hsla(0., 0., 0.88, 1.)),
808 editor_indent_guide_active: try_parse_color("#c9cbd1")
809 .unwrap_or(hsla(0., 0., 0.79, 1.)),
810 editor_document_highlight_read_background: try_parse_color("#4198ff0f")
811 .unwrap_or(hsla(0.58, 1., 0.63, 0.06)),
812 editor_document_highlight_write_background: try_parse_color("#4198ff66")
813 .unwrap_or(hsla(0.58, 1., 0.63, 0.4)),
814 terminal_background: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
815 terminal_foreground: try_parse_color("#383a42").unwrap_or(hsla(0., 0., 0.24, 1.)),
816 terminal_bright_foreground: try_parse_color("#2f313a")
817 .unwrap_or(hsla(0., 0., 0.21, 1.)),
818 terminal_dim_foreground: try_parse_color("#7e7f83")
819 .unwrap_or(hsla(0., 0., 0.5, 1.)),
820 terminal_ansi_black: try_parse_color("#fafafa").unwrap_or(hsla(0., 0., 0.98, 1.)),
821 terminal_ansi_bright_black: try_parse_color("#d8d9db")
822 .unwrap_or(hsla(0., 0., 0.85, 1.)),
823 terminal_ansi_dim_black: try_parse_color("#7e7f83")
824 .unwrap_or(hsla(0., 0., 0.5, 1.)),
825 terminal_ansi_red: try_parse_color("#e45649").unwrap_or(hsla(0.01, 0.74, 0.59, 1.)),
826 terminal_ansi_bright_red: try_parse_color("#ca695a")
827 .unwrap_or(hsla(0.02, 0.54, 0.58, 1.)),
828 terminal_ansi_dim_red: try_parse_color("#c24941")
829 .unwrap_or(hsla(0.01, 0.5, 0.5, 1.)),
830 terminal_ansi_green: try_parse_color("#50a14f")
831 .unwrap_or(hsla(0.33, 0.34, 0.47, 1.)),
832 terminal_ansi_bright_green: try_parse_color("#6db164")
833 .unwrap_or(hsla(0.35, 0.42, 0.55, 1.)),
834 terminal_ansi_dim_green: try_parse_color("#418141")
835 .unwrap_or(hsla(0.33, 0.33, 0.38, 1.)),
836 terminal_ansi_yellow: try_parse_color("#c18401")
837 .unwrap_or(hsla(0.11, 0.99, 0.38, 1.)),
838 terminal_ansi_bright_yellow: try_parse_color("#d49c3d")
839 .unwrap_or(hsla(0.11, 0.67, 0.53, 1.)),
840 terminal_ansi_dim_yellow: try_parse_color("#9e6a01")
841 .unwrap_or(hsla(0.11, 0.99, 0.31, 1.)),
842 terminal_ansi_blue: try_parse_color("#4078f2").unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
843 terminal_ansi_bright_blue: try_parse_color("#5085ce")
844 .unwrap_or(hsla(0.6, 0.6, 0.56, 1.)),
845 terminal_ansi_dim_blue: try_parse_color("#2d60c8")
846 .unwrap_or(hsla(0.6, 0.65, 0.48, 1.)),
847 terminal_ansi_magenta: try_parse_color("#a626a4")
848 .unwrap_or(hsla(0.83, 0.61, 0.4, 1.)),
849 terminal_ansi_bright_magenta: try_parse_color("#a84db2")
850 .unwrap_or(hsla(0.82, 0.42, 0.49, 1.)),
851 terminal_ansi_dim_magenta: try_parse_color("#841e83")
852 .unwrap_or(hsla(0.83, 0.64, 0.32, 1.)),
853 terminal_ansi_cyan: try_parse_color("#0184bc")
854 .unwrap_or(hsla(0.55, 0.99, 0.37, 1.)),
855 terminal_ansi_bright_cyan: try_parse_color("#4394c7")
856 .unwrap_or(hsla(0.55, 0.5, 0.52, 1.)),
857 terminal_ansi_dim_cyan: try_parse_color("#006a97")
858 .unwrap_or(hsla(0.55, 1., 0.29, 1.)),
859 terminal_ansi_white: try_parse_color("#1e2127").unwrap_or(hsla(0., 0., 0.13, 1.)),
860 terminal_ansi_bright_white: try_parse_color("#F0F0F0")
861 .unwrap_or(hsla(0., 0., 0.94, 1.)),
862 terminal_ansi_dim_white: try_parse_color("#383a42")
863 .unwrap_or(hsla(0., 0., 0.24, 1.)),
864 link_text_hover: try_parse_color("#0d74f0").unwrap_or(hsla(0.58, 0.9, 0.5, 1.)),
865 version_control_added: ADDED_COLOR,
866 version_control_modified: MODIFIED_COLOR,
867 version_control_deleted: REMOVED_COLOR,
868 version_control_conflict_marker_ours: try_parse_color("#50a14f")
869 .unwrap_or(hsla(0.3, 0.34, 0.47, 1.)),
870 version_control_conflict_marker_theirs: try_parse_color("#4078f2")
871 .unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
872 debugger_accent: try_parse_color("#a626a4").unwrap_or(hsla(0.83, 0.61, 0.4, 1.)),
873 editor_document_highlight_bracket_background: try_parse_color("#4198ff19")
874 .unwrap_or(hsla(0.58, 1., 0.63, 0.1)),
875 terminal_ansi_background: try_parse_color("#fafafa")
876 .unwrap_or(hsla(0., 0., 0.98, 1.)),
877 version_control_renamed: try_parse_color("#4078f2")
878 .unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
879 version_control_conflict: try_parse_color("#c18401")
880 .unwrap_or(hsla(0.11, 0.99, 0.38, 1.)),
881 version_control_ignored: try_parse_color("#a2a3a7")
882 .unwrap_or(hsla(0., 0., 0.64, 1.)),
883 },
884 status: StatusColors {
885 conflict: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
886 conflict_background: try_parse_color("#f2eeda")
887 .unwrap_or(hsla(0.11, 0.5, 0.91, 1.)),
888 conflict_border: try_parse_color("#e2d5b1").unwrap_or(hsla(0.11, 0.5, 0.78, 1.)),
889 created: try_parse_color("#50a14f").unwrap_or(hsla(0.3, 0.34, 0.47, 1.)),
890 created_background: try_parse_color("#e1eee1").unwrap_or(hsla(0.33, 0.23, 0.9, 1.)),
891 created_border: try_parse_color("#b7d4b7").unwrap_or(hsla(0.33, 0.29, 0.75, 1.)),
892 deleted: try_parse_color("#e45649").unwrap_or(hsla(0.01, 0.74, 0.59, 1.)),
893 deleted_background: try_parse_color("#fae0dd").unwrap_or(hsla(0.01, 0.7, 0.92, 1.)),
894 deleted_border: try_parse_color("#ecb8b2").unwrap_or(hsla(0.01, 0.6, 0.83, 1.)),
895 error: try_parse_color("#e45649").unwrap_or(hsla(0.01, 0.74, 0.59, 1.)),
896 error_background: try_parse_color("#fae0dd").unwrap_or(hsla(0.01, 0.7, 0.92, 1.)),
897 error_border: try_parse_color("#ecb8b2").unwrap_or(hsla(0.01, 0.6, 0.83, 1.)),
898 hidden: try_parse_color("#898b92").unwrap_or(hsla(0., 0., 0.55, 1.)),
899 hidden_background: try_parse_color("#f4f4f5").unwrap_or(hsla(0., 0., 0.96, 1.)),
900 hidden_border: try_parse_color("#e1e2e5").unwrap_or(hsla(0., 0., 0.89, 1.)),
901 hint: try_parse_color("#6b6d76").unwrap_or(hsla(0., 0., 0.44, 1.)),
902 hint_background: try_parse_color("#e8e8ed").unwrap_or(hsla(0.64, 0.15, 0.91, 1.)),
903 hint_border: try_parse_color("#c8c9d5").unwrap_or(hsla(0.64, 0.18, 0.81, 1.)),
904 ignored: try_parse_color("#898b92").unwrap_or(hsla(0., 0., 0.55, 1.)),
905 ignored_background: try_parse_color("#f4f4f5").unwrap_or(hsla(0., 0., 0.96, 1.)),
906 ignored_border: try_parse_color("#e1e2e5").unwrap_or(hsla(0., 0., 0.89, 1.)),
907 info: try_parse_color("#4078f2").unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
908 info_background: try_parse_color("#d9e4fa").unwrap_or(hsla(0.6, 0.75, 0.92, 1.)),
909 info_border: try_parse_color("#a9c0ea").unwrap_or(hsla(0.6, 0.55, 0.77, 1.)),
910 modified: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
911 modified_background: try_parse_color("#f2eeda")
912 .unwrap_or(hsla(0.11, 0.5, 0.91, 1.)),
913 modified_border: try_parse_color("#e2d5b1").unwrap_or(hsla(0.11, 0.5, 0.78, 1.)),
914 predictive: try_parse_color("#969799").unwrap_or(hsla(0., 0., 0.59, 1.)),
915 predictive_background: try_parse_color("#f5f5f5").unwrap_or(hsla(0., 0., 0.96, 1.)),
916 predictive_border: try_parse_color("#e4e4e5").unwrap_or(hsla(0., 0., 0.89, 1.)),
917 renamed: try_parse_color("#4078f2").unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
918 renamed_background: try_parse_color("#d9e4fa").unwrap_or(hsla(0.6, 0.75, 0.92, 1.)),
919 renamed_border: try_parse_color("#a9c0ea").unwrap_or(hsla(0.6, 0.55, 0.77, 1.)),
920 success: try_parse_color("#50a14f").unwrap_or(hsla(0.3, 0.34, 0.47, 1.)),
921 success_background: try_parse_color("#e1eee1").unwrap_or(hsla(0.33, 0.23, 0.9, 1.)),
922 success_border: try_parse_color("#b7d4b7").unwrap_or(hsla(0.33, 0.29, 0.75, 1.)),
923 unreachable: try_parse_color("#898b92").unwrap_or(hsla(0., 0., 0.55, 1.)),
924 unreachable_background: try_parse_color("#f4f4f5")
925 .unwrap_or(hsla(0., 0., 0.96, 1.)),
926 unreachable_border: try_parse_color("#e1e2e5").unwrap_or(hsla(0., 0., 0.89, 1.)),
927 warning: try_parse_color("#e5c07b").unwrap_or(hsla(0.11, 0.67, 0.67, 1.)),
928 warning_background: try_parse_color("#f2eeda").unwrap_or(hsla(0.11, 0.5, 0.91, 1.)),
929 warning_border: try_parse_color("#e2d5b1").unwrap_or(hsla(0.11, 0.5, 0.78, 1.)),
930 },
931 player: PlayerColors(vec![
932 PlayerColor {
933 cursor: try_parse_color("#4078f2").unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
934 background: try_parse_color("#4078f2").unwrap_or(hsla(0.6, 0.88, 0.6, 1.)),
935 selection: try_parse_color("#4078f23d").unwrap_or(hsla(0.6, 0.88, 0.6, 0.24)),
936 },
937 PlayerColor {
938 cursor: try_parse_color("#994cc3").unwrap_or(hsla(0.77, 0.5, 0.53, 1.)),
939 background: try_parse_color("#994cc3").unwrap_or(hsla(0.77, 0.5, 0.53, 1.)),
940 selection: try_parse_color("#994cc33d").unwrap_or(hsla(0.77, 0.5, 0.53, 0.24)),
941 },
942 PlayerColor {
943 cursor: try_parse_color("#0aa579").unwrap_or(hsla(0.45, 0.9, 0.34, 1.)),
944 background: try_parse_color("#0aa579").unwrap_or(hsla(0.45, 0.9, 0.34, 1.)),
945 selection: try_parse_color("#0aa5793d").unwrap_or(hsla(0.45, 0.9, 0.34, 0.24)),
946 },
947 PlayerColor {
948 cursor: try_parse_color("#d4333c").unwrap_or(hsla(0.98, 0.63, 0.52, 1.)),
949 background: try_parse_color("#d4333c").unwrap_or(hsla(0.98, 0.63, 0.52, 1.)),
950 selection: try_parse_color("#d4333c3d").unwrap_or(hsla(0.98, 0.63, 0.52, 0.24)),
951 },
952 PlayerColor {
953 cursor: try_parse_color("#d46600").unwrap_or(hsla(0.08, 1., 0.42, 1.)),
954 background: try_parse_color("#d46600").unwrap_or(hsla(0.08, 1., 0.42, 1.)),
955 selection: try_parse_color("#d466003d").unwrap_or(hsla(0.08, 1., 0.42, 0.24)),
956 },
957 PlayerColor {
958 cursor: try_parse_color("#ff69b4").unwrap_or(hsla(0.92, 1., 0.71, 1.)),
959 background: try_parse_color("#ff69b4").unwrap_or(hsla(0.92, 1., 0.71, 1.)),
960 selection: try_parse_color("#ff69b43d").unwrap_or(hsla(0.92, 1., 0.71, 0.24)),
961 },
962 PlayerColor {
963 cursor: try_parse_color("#00a8cc").unwrap_or(hsla(0.54, 1., 0.4, 1.)),
964 background: try_parse_color("#00a8cc").unwrap_or(hsla(0.54, 1., 0.4, 1.)),
965 selection: try_parse_color("#00a8cc3d").unwrap_or(hsla(0.54, 1., 0.4, 0.24)),
966 },
967 PlayerColor {
968 cursor: try_parse_color("#00ff00").unwrap_or(hsla(0.33, 1., 0.5, 1.)),
969 background: try_parse_color("#00ff00").unwrap_or(hsla(0.33, 1., 0.5, 1.)),
970 selection: try_parse_color("#00ff003d").unwrap_or(hsla(0.33, 1., 0.5, 0.24)),
971 },
972 ]),
973 syntax: Arc::new(SyntaxTheme {
974 highlights: vec![
975 (
976 "attribute".to_string(),
977 HighlightStyle {
978 color: try_parse_color("#c18401")
979 .map(Some)
980 .unwrap_or(Some(hsla(0.11, 0.99, 0.38, 1.))),
981 font_style: None,
982 font_weight: None,
983 ..Default::default()
984 },
985 ),
986 (
987 "boolean".to_string(),
988 HighlightStyle {
989 color: try_parse_color("#986801")
990 .map(Some)
991 .unwrap_or(Some(hsla(0.11, 0.99, 0.3, 1.))),
992 font_style: None,
993 font_weight: None,
994 ..Default::default()
995 },
996 ),
997 (
998 "comment".to_string(),
999 HighlightStyle {
1000 color: try_parse_color("#b0b2b6")
1001 .map(Some)
1002 .unwrap_or(Some(hsla(0., 0., 0.7, 1.))),
1003 font_style: Some(gpui::FontStyle::Italic),
1004 font_weight: None,
1005 ..Default::default()
1006 },
1007 ),
1008 (
1009 "comment.doc".to_string(),
1010 HighlightStyle {
1011 color: try_parse_color("#9b9da3")
1012 .map(Some)
1013 .unwrap_or(Some(hsla(0., 0., 0.62, 1.))),
1014 font_style: Some(gpui::FontStyle::Italic),
1015 font_weight: None,
1016 ..Default::default()
1017 },
1018 ),
1019 (
1020 "constant".to_string(),
1021 HighlightStyle {
1022 color: try_parse_color("#986801")
1023 .map(Some)
1024 .unwrap_or(Some(hsla(0.11, 0.99, 0.3, 1.))),
1025 font_style: None,
1026 font_weight: None,
1027 ..Default::default()
1028 },
1029 ),
1030 (
1031 "constructor".to_string(),
1032 HighlightStyle {
1033 color: try_parse_color("#4078f2")
1034 .map(Some)
1035 .unwrap_or(Some(hsla(0.6, 0.88, 0.6, 1.))),
1036 font_style: None,
1037 font_weight: None,
1038 ..Default::default()
1039 },
1040 ),
1041 (
1042 "emphasis".to_string(),
1043 HighlightStyle {
1044 color: try_parse_color("#0d74f0")
1045 .map(Some)
1046 .unwrap_or(Some(hsla(0.58, 0.9, 0.5, 1.))),
1047 font_style: Some(gpui::FontStyle::Italic),
1048 font_weight: None,
1049 ..Default::default()
1050 },
1051 ),
1052 (
1053 "emphasis.strong".to_string(),
1054 HighlightStyle {
1055 color: try_parse_color("#0d74f0")
1056 .map(Some)
1057 .unwrap_or(Some(hsla(0.58, 0.9, 0.5, 1.))),
1058 font_style: None,
1059 font_weight: Some(gpui::FontWeight::BOLD),
1060 ..Default::default()
1061 },
1062 ),
1063 (
1064 "function".to_string(),
1065 HighlightStyle {
1066 color: try_parse_color("#4078f2")
1067 .map(Some)
1068 .unwrap_or(Some(hsla(0.6, 0.88, 0.6, 1.))),
1069 font_style: None,
1070 font_weight: None,
1071 ..Default::default()
1072 },
1073 ),
1074 (
1075 "keyword".to_string(),
1076 HighlightStyle {
1077 color: try_parse_color("#a626a4")
1078 .map(Some)
1079 .unwrap_or(Some(hsla(0.83, 0.61, 0.4, 1.))),
1080 font_style: None,
1081 font_weight: None,
1082 ..Default::default()
1083 },
1084 ),
1085 (
1086 "label".to_string(),
1087 HighlightStyle {
1088 color: try_parse_color("#4078f2")
1089 .map(Some)
1090 .unwrap_or(Some(hsla(0.6, 0.88, 0.6, 1.))),
1091 font_style: None,
1092 font_weight: None,
1093 ..Default::default()
1094 },
1095 ),
1096 (
1097 "link_text".to_string(),
1098 HighlightStyle {
1099 color: try_parse_color("#5685f5")
1100 .map(Some)
1101 .unwrap_or(Some(hsla(0.6, 0.9, 0.65, 1.))),
1102 font_style: None,
1103 font_weight: None,
1104 ..Default::default()
1105 },
1106 ),
1107 (
1108 "link_uri".to_string(),
1109 HighlightStyle {
1110 color: try_parse_color("#0184bc")
1111 .map(Some)
1112 .unwrap_or(Some(hsla(0.55, 0.99, 0.37, 1.))),
1113 font_style: None,
1114 font_weight: None,
1115 ..Default::default()
1116 },
1117 ),
1118 (
1119 "number".to_string(),
1120 HighlightStyle {
1121 color: try_parse_color("#986801")
1122 .map(Some)
1123 .unwrap_or(Some(hsla(0.11, 0.99, 0.3, 1.))),
1124 font_style: None,
1125 font_weight: None,
1126 ..Default::default()
1127 },
1128 ),
1129 (
1130 "operator".to_string(),
1131 HighlightStyle {
1132 color: try_parse_color("#0184bc")
1133 .map(Some)
1134 .unwrap_or(Some(hsla(0.55, 0.99, 0.37, 1.))),
1135 font_style: None,
1136 font_weight: None,
1137 ..Default::default()
1138 },
1139 ),
1140 (
1141 "preproc".to_string(),
1142 HighlightStyle {
1143 color: try_parse_color("#a626a4")
1144 .map(Some)
1145 .unwrap_or(Some(hsla(0.83, 0.61, 0.4, 1.))),
1146 font_style: None,
1147 font_weight: None,
1148 ..Default::default()
1149 },
1150 ),
1151 (
1152 "property".to_string(),
1153 HighlightStyle {
1154 color: try_parse_color("#e45649")
1155 .map(Some)
1156 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1157 font_style: None,
1158 font_weight: None,
1159 ..Default::default()
1160 },
1161 ),
1162 (
1163 "punctuation".to_string(),
1164 HighlightStyle {
1165 color: try_parse_color("#383a42")
1166 .map(Some)
1167 .unwrap_or(Some(hsla(0., 0., 0.24, 1.))),
1168 font_style: None,
1169 font_weight: None,
1170 ..Default::default()
1171 },
1172 ),
1173 (
1174 "punctuation.bracket".to_string(),
1175 HighlightStyle {
1176 color: try_parse_color("#383a42")
1177 .map(Some)
1178 .unwrap_or(Some(hsla(0., 0., 0.24, 1.))),
1179 font_style: None,
1180 font_weight: None,
1181 ..Default::default()
1182 },
1183 ),
1184 (
1185 "punctuation.delimiter".to_string(),
1186 HighlightStyle {
1187 color: try_parse_color("#383a42")
1188 .map(Some)
1189 .unwrap_or(Some(hsla(0., 0., 0.24, 1.))),
1190 font_style: None,
1191 font_weight: None,
1192 ..Default::default()
1193 },
1194 ),
1195 (
1196 "punctuation.list_marker".to_string(),
1197 HighlightStyle {
1198 color: try_parse_color("#e45649")
1199 .map(Some)
1200 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1201 font_style: None,
1202 font_weight: None,
1203 ..Default::default()
1204 },
1205 ),
1206 (
1207 "punctuation.special".to_string(),
1208 HighlightStyle {
1209 color: try_parse_color("#e45649")
1210 .map(Some)
1211 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1212 font_style: None,
1213 font_weight: None,
1214 ..Default::default()
1215 },
1216 ),
1217 (
1218 "string".to_string(),
1219 HighlightStyle {
1220 color: try_parse_color("#50a14f")
1221 .map(Some)
1222 .unwrap_or(Some(hsla(0.3, 0.34, 0.47, 1.))),
1223 font_style: None,
1224 font_weight: None,
1225 ..Default::default()
1226 },
1227 ),
1228 (
1229 "string.escape".to_string(),
1230 HighlightStyle {
1231 color: try_parse_color("#0184bc")
1232 .map(Some)
1233 .unwrap_or(Some(hsla(0.55, 0.99, 0.37, 1.))),
1234 font_style: None,
1235 font_weight: None,
1236 ..Default::default()
1237 },
1238 ),
1239 (
1240 "string.regex".to_string(),
1241 HighlightStyle {
1242 color: try_parse_color("#e45649")
1243 .map(Some)
1244 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1245 font_style: None,
1246 font_weight: None,
1247 ..Default::default()
1248 },
1249 ),
1250 (
1251 "string.special".to_string(),
1252 HighlightStyle {
1253 color: try_parse_color("#e45649")
1254 .map(Some)
1255 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1256 font_style: None,
1257 font_weight: None,
1258 ..Default::default()
1259 },
1260 ),
1261 (
1262 "string.special.symbol".to_string(),
1263 HighlightStyle {
1264 color: try_parse_color("#50a14f")
1265 .map(Some)
1266 .unwrap_or(Some(hsla(0.3, 0.34, 0.47, 1.))),
1267 font_style: None,
1268 font_weight: None,
1269 ..Default::default()
1270 },
1271 ),
1272 (
1273 "tag".to_string(),
1274 HighlightStyle {
1275 color: try_parse_color("#e45649")
1276 .map(Some)
1277 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1278 font_style: None,
1279 font_weight: None,
1280 ..Default::default()
1281 },
1282 ),
1283 (
1284 "text.literal".to_string(),
1285 HighlightStyle {
1286 color: try_parse_color("#50a14f")
1287 .map(Some)
1288 .unwrap_or(Some(hsla(0.3, 0.34, 0.47, 1.))),
1289 font_style: None,
1290 font_weight: None,
1291 ..Default::default()
1292 },
1293 ),
1294 (
1295 "title".to_string(),
1296 HighlightStyle {
1297 color: try_parse_color("#4078f2")
1298 .map(Some)
1299 .unwrap_or(Some(hsla(0.6, 0.88, 0.6, 1.))),
1300 font_style: None,
1301 font_weight: Some(gpui::FontWeight::BOLD),
1302 ..Default::default()
1303 },
1304 ),
1305 (
1306 "type".to_string(),
1307 HighlightStyle {
1308 color: try_parse_color("#c18401")
1309 .map(Some)
1310 .unwrap_or(Some(hsla(0.11, 0.99, 0.38, 1.))),
1311 font_style: None,
1312 font_weight: None,
1313 ..Default::default()
1314 },
1315 ),
1316 (
1317 "variable".to_string(),
1318 HighlightStyle {
1319 color: try_parse_color("#e45649")
1320 .map(Some)
1321 .unwrap_or(Some(hsla(0.01, 0.74, 0.59, 1.))),
1322 font_style: None,
1323 font_weight: None,
1324 ..Default::default()
1325 },
1326 ),
1327 (
1328 "variable.special".to_string(),
1329 HighlightStyle {
1330 color: try_parse_color("#a626a4")
1331 .map(Some)
1332 .unwrap_or(Some(hsla(0.83, 0.61, 0.4, 1.))),
1333 font_style: None,
1334 font_weight: None,
1335 ..Default::default()
1336 },
1337 ),
1338 (
1339 "variant".to_string(),
1340 HighlightStyle {
1341 color: try_parse_color("#4078f2")
1342 .map(Some)
1343 .unwrap_or(Some(hsla(0.6, 0.88, 0.6, 1.))),
1344 font_style: None,
1345 font_weight: None,
1346 ..Default::default()
1347 },
1348 ),
1349 ],
1350 }),
1351 },
1352 }
1353}