1mod theme_registry;
2
3use gpui::{
4 color::Color,
5 elements::{ContainerStyle, ImageStyle, LabelStyle, TooltipStyle},
6 fonts::{HighlightStyle, TextStyle},
7 Border, MouseState,
8};
9use serde::{de::DeserializeOwned, Deserialize};
10use serde_json::Value;
11use std::{collections::HashMap, sync::Arc};
12
13pub use theme_registry::*;
14
15#[derive(Deserialize, Default)]
16pub struct Theme {
17 #[serde(default)]
18 pub meta: ThemeMeta,
19 pub workspace: Workspace,
20 pub context_menu: ContextMenu,
21 pub chat_panel: ChatPanel,
22 pub contacts_popover: ContactsPopover,
23 pub contact_list: ContactList,
24 pub contact_finder: ContactFinder,
25 pub project_panel: ProjectPanel,
26 pub command_palette: CommandPalette,
27 pub picker: Picker,
28 pub editor: Editor,
29 pub search: Search,
30 pub project_diagnostics: ProjectDiagnostics,
31 pub breadcrumbs: ContainedText,
32 pub contact_notification: ContactNotification,
33 pub update_notification: UpdateNotification,
34 pub project_shared_notification: ProjectSharedNotification,
35 pub incoming_call_notification: IncomingCallNotification,
36 pub tooltip: TooltipStyle,
37 pub terminal: TerminalStyle,
38}
39
40#[derive(Deserialize, Default, Clone)]
41pub struct ThemeMeta {
42 pub name: String,
43 pub is_light: bool,
44}
45
46#[derive(Deserialize, Default)]
47pub struct Workspace {
48 pub background: Color,
49 pub titlebar: Titlebar,
50 pub tab_bar: TabBar,
51 pub pane_divider: Border,
52 pub leader_border_opacity: f32,
53 pub leader_border_width: f32,
54 pub sidebar: Sidebar,
55 pub status_bar: StatusBar,
56 pub toolbar: Toolbar,
57 pub disconnected_overlay: ContainedText,
58 pub modal: ContainerStyle,
59 pub notification: ContainerStyle,
60 pub notifications: Notifications,
61 pub joining_project_avatar: ImageStyle,
62 pub joining_project_message: ContainedText,
63 pub external_location_message: ContainedText,
64 pub dock: Dock,
65}
66
67#[derive(Clone, Deserialize, Default)]
68pub struct Titlebar {
69 #[serde(flatten)]
70 pub container: ContainerStyle,
71 pub height: f32,
72 pub title: TextStyle,
73 pub avatar_width: f32,
74 pub avatar_margin: f32,
75 pub avatar_ribbon: AvatarRibbon,
76 pub offline_icon: OfflineIcon,
77 pub avatar: ImageStyle,
78 pub inactive_avatar: ImageStyle,
79 pub sign_in_prompt: Interactive<ContainedText>,
80 pub outdated_warning: ContainedText,
81 pub share_button: Interactive<ContainedText>,
82 pub call_control: Interactive<IconButton>,
83 pub toggle_contacts_button: Interactive<IconButton>,
84 pub toggle_contacts_badge: ContainerStyle,
85}
86
87#[derive(Deserialize, Default)]
88pub struct ContactsPopover {
89 #[serde(flatten)]
90 pub container: ContainerStyle,
91 pub height: f32,
92 pub width: f32,
93 pub invite_row_height: f32,
94 pub invite_row: Interactive<ContainedLabel>,
95}
96
97#[derive(Deserialize, Default)]
98pub struct ContactList {
99 pub user_query_editor: FieldEditor,
100 pub user_query_editor_height: f32,
101 pub add_contact_button: IconButton,
102 pub header_row: Interactive<ContainedText>,
103 pub leave_call: Interactive<ContainedText>,
104 pub contact_row: Interactive<ContainerStyle>,
105 pub row_height: f32,
106 pub project_row: Interactive<ProjectRow>,
107 pub tree_branch: Interactive<TreeBranch>,
108 pub contact_avatar: ImageStyle,
109 pub contact_status_free: ContainerStyle,
110 pub contact_status_busy: ContainerStyle,
111 pub contact_username: ContainedText,
112 pub contact_button: Interactive<IconButton>,
113 pub contact_button_spacing: f32,
114 pub disabled_button: IconButton,
115 pub section_icon_size: f32,
116 pub calling_indicator: ContainedText,
117}
118
119#[derive(Deserialize, Default)]
120pub struct ProjectRow {
121 #[serde(flatten)]
122 pub container: ContainerStyle,
123 pub name: ContainedText,
124}
125
126#[derive(Deserialize, Default, Clone, Copy)]
127pub struct TreeBranch {
128 pub width: f32,
129 pub color: Color,
130}
131
132#[derive(Deserialize, Default)]
133pub struct ContactFinder {
134 pub picker: Picker,
135 pub row_height: f32,
136 pub contact_avatar: ImageStyle,
137 pub contact_username: ContainerStyle,
138 pub contact_button: IconButton,
139 pub disabled_contact_button: IconButton,
140}
141
142#[derive(Clone, Deserialize, Default)]
143pub struct TabBar {
144 #[serde(flatten)]
145 pub container: ContainerStyle,
146 pub pane_button: Interactive<IconButton>,
147 pub pane_button_container: ContainerStyle,
148 pub active_pane: TabStyles,
149 pub inactive_pane: TabStyles,
150 pub dragged_tab: Tab,
151 pub height: f32,
152 pub drop_target_overlay_color: Color,
153}
154
155impl TabBar {
156 pub fn tab_style(&self, pane_active: bool, tab_active: bool) -> &Tab {
157 let tabs = if pane_active {
158 &self.active_pane
159 } else {
160 &self.inactive_pane
161 };
162
163 if tab_active {
164 &tabs.active_tab
165 } else {
166 &tabs.inactive_tab
167 }
168 }
169}
170
171#[derive(Clone, Deserialize, Default)]
172pub struct TabStyles {
173 pub active_tab: Tab,
174 pub inactive_tab: Tab,
175}
176
177#[derive(Clone, Deserialize, Default)]
178pub struct AvatarRibbon {
179 #[serde(flatten)]
180 pub container: ContainerStyle,
181 pub width: f32,
182 pub height: f32,
183}
184
185#[derive(Clone, Deserialize, Default)]
186pub struct OfflineIcon {
187 #[serde(flatten)]
188 pub container: ContainerStyle,
189 pub width: f32,
190 pub color: Color,
191}
192
193#[derive(Clone, Deserialize, Default)]
194pub struct Tab {
195 pub height: f32,
196 #[serde(flatten)]
197 pub container: ContainerStyle,
198 #[serde(flatten)]
199 pub label: LabelStyle,
200 pub description: ContainedText,
201 pub spacing: f32,
202 pub icon_width: f32,
203 pub icon_close: Color,
204 pub icon_close_active: Color,
205 pub icon_dirty: Color,
206 pub icon_conflict: Color,
207}
208
209#[derive(Clone, Deserialize, Default)]
210pub struct Toolbar {
211 #[serde(flatten)]
212 pub container: ContainerStyle,
213 pub height: f32,
214 pub item_spacing: f32,
215 pub nav_button: Interactive<IconButton>,
216}
217
218#[derive(Clone, Deserialize, Default)]
219pub struct Dock {
220 pub initial_size_right: f32,
221 pub initial_size_bottom: f32,
222 pub wash_color: Color,
223 pub panel: ContainerStyle,
224 pub maximized: ContainerStyle,
225}
226
227#[derive(Clone, Deserialize, Default)]
228pub struct Notifications {
229 #[serde(flatten)]
230 pub container: ContainerStyle,
231 pub width: f32,
232}
233
234#[derive(Clone, Deserialize, Default)]
235pub struct Search {
236 #[serde(flatten)]
237 pub container: ContainerStyle,
238 pub editor: FindEditor,
239 pub invalid_editor: ContainerStyle,
240 pub option_button_group: ContainerStyle,
241 pub option_button: Interactive<ContainedText>,
242 pub match_background: Color,
243 pub match_index: ContainedText,
244 pub results_status: TextStyle,
245 pub tab_icon_width: f32,
246 pub tab_icon_spacing: f32,
247}
248
249#[derive(Clone, Deserialize, Default)]
250pub struct FindEditor {
251 #[serde(flatten)]
252 pub input: FieldEditor,
253 pub min_width: f32,
254 pub max_width: f32,
255}
256
257#[derive(Deserialize, Default)]
258pub struct StatusBar {
259 #[serde(flatten)]
260 pub container: ContainerStyle,
261 pub height: f32,
262 pub item_spacing: f32,
263 pub cursor_position: TextStyle,
264 pub auto_update_progress_message: TextStyle,
265 pub auto_update_done_message: TextStyle,
266 pub lsp_status: Interactive<StatusBarLspStatus>,
267 pub feedback: Interactive<TextStyle>,
268 pub sidebar_buttons: StatusBarSidebarButtons,
269 pub diagnostic_summary: Interactive<StatusBarDiagnosticSummary>,
270 pub diagnostic_message: Interactive<ContainedText>,
271}
272
273#[derive(Deserialize, Default)]
274pub struct StatusBarSidebarButtons {
275 pub group_left: ContainerStyle,
276 pub group_right: ContainerStyle,
277 pub item: Interactive<SidebarItem>,
278 pub badge: ContainerStyle,
279}
280
281#[derive(Deserialize, Default)]
282pub struct StatusBarDiagnosticSummary {
283 pub container_ok: ContainerStyle,
284 pub container_warning: ContainerStyle,
285 pub container_error: ContainerStyle,
286 pub text: TextStyle,
287 pub icon_color_ok: Color,
288 pub icon_color_warning: Color,
289 pub icon_color_error: Color,
290 pub height: f32,
291 pub icon_width: f32,
292 pub icon_spacing: f32,
293 pub summary_spacing: f32,
294}
295
296#[derive(Deserialize, Default)]
297pub struct StatusBarLspStatus {
298 #[serde(flatten)]
299 pub container: ContainerStyle,
300 pub height: f32,
301 pub icon_spacing: f32,
302 pub icon_color: Color,
303 pub icon_width: f32,
304 pub message: TextStyle,
305}
306
307#[derive(Deserialize, Default)]
308pub struct Sidebar {
309 pub initial_size: f32,
310 #[serde(flatten)]
311 pub container: ContainerStyle,
312}
313
314#[derive(Clone, Copy, Deserialize, Default)]
315pub struct SidebarItem {
316 #[serde(flatten)]
317 pub container: ContainerStyle,
318 pub icon_color: Color,
319 pub icon_size: f32,
320}
321
322#[derive(Deserialize, Default)]
323pub struct ChatPanel {
324 #[serde(flatten)]
325 pub container: ContainerStyle,
326 pub message: ChatMessage,
327 pub pending_message: ChatMessage,
328 pub channel_select: ChannelSelect,
329 pub input_editor: FieldEditor,
330 pub sign_in_prompt: TextStyle,
331 pub hovered_sign_in_prompt: TextStyle,
332}
333
334#[derive(Deserialize, Default)]
335pub struct ProjectPanel {
336 #[serde(flatten)]
337 pub container: ContainerStyle,
338 pub entry: Interactive<ProjectPanelEntry>,
339 pub cut_entry_fade: f32,
340 pub ignored_entry_fade: f32,
341 pub filename_editor: FieldEditor,
342 pub indent_width: f32,
343}
344
345#[derive(Clone, Debug, Deserialize, Default)]
346pub struct ProjectPanelEntry {
347 pub height: f32,
348 #[serde(flatten)]
349 pub container: ContainerStyle,
350 pub text: TextStyle,
351 pub icon_color: Color,
352 pub icon_size: f32,
353 pub icon_spacing: f32,
354}
355
356#[derive(Clone, Debug, Deserialize, Default)]
357pub struct ContextMenu {
358 #[serde(flatten)]
359 pub container: ContainerStyle,
360 pub item: Interactive<ContextMenuItem>,
361 pub keystroke_margin: f32,
362 pub separator: ContainerStyle,
363}
364
365#[derive(Clone, Debug, Deserialize, Default)]
366pub struct ContextMenuItem {
367 #[serde(flatten)]
368 pub container: ContainerStyle,
369 pub label: TextStyle,
370 pub keystroke: ContainedText,
371 pub icon_width: f32,
372 pub icon_spacing: f32,
373}
374
375#[derive(Debug, Deserialize, Default)]
376pub struct CommandPalette {
377 pub key: Interactive<ContainedLabel>,
378 pub keystroke_spacing: f32,
379}
380
381#[derive(Deserialize, Default)]
382pub struct InviteLink {
383 #[serde(flatten)]
384 pub container: ContainerStyle,
385 #[serde(flatten)]
386 pub label: LabelStyle,
387 pub icon: Icon,
388}
389
390#[derive(Deserialize, Default)]
391pub struct Icon {
392 #[serde(flatten)]
393 pub container: ContainerStyle,
394 pub color: Color,
395 pub width: f32,
396 pub path: String,
397}
398
399#[derive(Deserialize, Clone, Copy, Default)]
400pub struct IconButton {
401 #[serde(flatten)]
402 pub container: ContainerStyle,
403 pub color: Color,
404 pub icon_width: f32,
405 pub button_width: f32,
406}
407
408#[derive(Deserialize, Default)]
409pub struct ChatMessage {
410 #[serde(flatten)]
411 pub container: ContainerStyle,
412 pub body: TextStyle,
413 pub sender: ContainedText,
414 pub timestamp: ContainedText,
415}
416
417#[derive(Deserialize, Default)]
418pub struct ChannelSelect {
419 #[serde(flatten)]
420 pub container: ContainerStyle,
421 pub header: ChannelName,
422 pub item: ChannelName,
423 pub active_item: ChannelName,
424 pub hovered_item: ChannelName,
425 pub hovered_active_item: ChannelName,
426 pub menu: ContainerStyle,
427}
428
429#[derive(Deserialize, Default)]
430pub struct ChannelName {
431 #[serde(flatten)]
432 pub container: ContainerStyle,
433 pub hash: ContainedText,
434 pub name: TextStyle,
435}
436
437#[derive(Deserialize, Default)]
438pub struct Picker {
439 #[serde(flatten)]
440 pub container: ContainerStyle,
441 pub empty: ContainedLabel,
442 pub input_editor: FieldEditor,
443 pub item: Interactive<ContainedLabel>,
444}
445
446#[derive(Clone, Debug, Deserialize, Default)]
447pub struct ContainedText {
448 #[serde(flatten)]
449 pub container: ContainerStyle,
450 #[serde(flatten)]
451 pub text: TextStyle,
452}
453
454#[derive(Clone, Debug, Deserialize, Default)]
455pub struct ContainedLabel {
456 #[serde(flatten)]
457 pub container: ContainerStyle,
458 #[serde(flatten)]
459 pub label: LabelStyle,
460}
461
462#[derive(Clone, Deserialize, Default)]
463pub struct ProjectDiagnostics {
464 #[serde(flatten)]
465 pub container: ContainerStyle,
466 pub empty_message: TextStyle,
467 pub tab_icon_width: f32,
468 pub tab_icon_spacing: f32,
469 pub tab_summary_spacing: f32,
470}
471
472#[derive(Deserialize, Default)]
473pub struct ContactNotification {
474 pub header_avatar: ImageStyle,
475 pub header_message: ContainedText,
476 pub header_height: f32,
477 pub body_message: ContainedText,
478 pub button: Interactive<ContainedText>,
479 pub dismiss_button: Interactive<IconButton>,
480}
481
482#[derive(Deserialize, Default)]
483pub struct UpdateNotification {
484 pub message: ContainedText,
485 pub action_message: Interactive<ContainedText>,
486 pub dismiss_button: Interactive<IconButton>,
487}
488
489#[derive(Deserialize, Default)]
490pub struct ProjectSharedNotification {
491 pub window_height: f32,
492 pub window_width: f32,
493 #[serde(default)]
494 pub background: Color,
495 pub owner_container: ContainerStyle,
496 pub owner_avatar: ImageStyle,
497 pub owner_metadata: ContainerStyle,
498 pub owner_username: ContainedText,
499 pub message: ContainedText,
500 pub worktree_roots: ContainedText,
501 pub button_width: f32,
502 pub open_button: ContainedText,
503 pub dismiss_button: ContainedText,
504}
505
506#[derive(Deserialize, Default)]
507pub struct IncomingCallNotification {
508 pub window_height: f32,
509 pub window_width: f32,
510 #[serde(default)]
511 pub background: Color,
512 pub caller_container: ContainerStyle,
513 pub caller_avatar: ImageStyle,
514 pub caller_metadata: ContainerStyle,
515 pub caller_username: ContainedText,
516 pub caller_message: ContainedText,
517 pub worktree_roots: ContainedText,
518 pub button_width: f32,
519 pub accept_button: ContainedText,
520 pub decline_button: ContainedText,
521}
522
523#[derive(Clone, Deserialize, Default)]
524pub struct Editor {
525 pub text_color: Color,
526 #[serde(default)]
527 pub background: Color,
528 pub selection: SelectionStyle,
529 pub gutter_background: Color,
530 pub gutter_padding_factor: f32,
531 pub active_line_background: Color,
532 pub highlighted_line_background: Color,
533 pub rename_fade: f32,
534 pub document_highlight_read_background: Color,
535 pub document_highlight_write_background: Color,
536 pub diff: DiffStyle,
537 pub line_number: Color,
538 pub line_number_active: Color,
539 pub guest_selections: Vec<SelectionStyle>,
540 pub syntax: Arc<SyntaxTheme>,
541 pub diagnostic_path_header: DiagnosticPathHeader,
542 pub diagnostic_header: DiagnosticHeader,
543 pub error_diagnostic: DiagnosticStyle,
544 pub invalid_error_diagnostic: DiagnosticStyle,
545 pub warning_diagnostic: DiagnosticStyle,
546 pub invalid_warning_diagnostic: DiagnosticStyle,
547 pub information_diagnostic: DiagnosticStyle,
548 pub invalid_information_diagnostic: DiagnosticStyle,
549 pub hint_diagnostic: DiagnosticStyle,
550 pub invalid_hint_diagnostic: DiagnosticStyle,
551 pub autocomplete: AutocompleteStyle,
552 pub code_actions: CodeActions,
553 pub unnecessary_code_fade: f32,
554 pub hover_popover: HoverPopover,
555 pub link_definition: HighlightStyle,
556 pub composition_mark: HighlightStyle,
557 pub jump_icon: Interactive<IconButton>,
558 pub scrollbar: Scrollbar,
559}
560
561#[derive(Clone, Deserialize, Default)]
562pub struct Scrollbar {
563 pub track: ContainerStyle,
564 pub thumb: ContainerStyle,
565 pub width: f32,
566 pub min_height_factor: f32,
567}
568
569#[derive(Clone, Deserialize, Default)]
570pub struct DiagnosticPathHeader {
571 #[serde(flatten)]
572 pub container: ContainerStyle,
573 pub filename: ContainedText,
574 pub path: ContainedText,
575 pub text_scale_factor: f32,
576}
577
578#[derive(Clone, Deserialize, Default)]
579pub struct DiagnosticHeader {
580 #[serde(flatten)]
581 pub container: ContainerStyle,
582 pub message: ContainedLabel,
583 pub code: ContainedText,
584 pub text_scale_factor: f32,
585 pub icon_width_factor: f32,
586}
587
588#[derive(Clone, Deserialize, Default)]
589pub struct DiagnosticStyle {
590 pub message: LabelStyle,
591 #[serde(default)]
592 pub header: ContainerStyle,
593 pub text_scale_factor: f32,
594}
595
596#[derive(Clone, Deserialize, Default)]
597pub struct AutocompleteStyle {
598 #[serde(flatten)]
599 pub container: ContainerStyle,
600 pub item: ContainerStyle,
601 pub selected_item: ContainerStyle,
602 pub hovered_item: ContainerStyle,
603 pub match_highlight: HighlightStyle,
604}
605
606#[derive(Clone, Copy, Default, Deserialize)]
607pub struct SelectionStyle {
608 pub cursor: Color,
609 pub selection: Color,
610}
611
612#[derive(Clone, Deserialize, Default)]
613pub struct FieldEditor {
614 #[serde(flatten)]
615 pub container: ContainerStyle,
616 pub text: TextStyle,
617 #[serde(default)]
618 pub placeholder_text: Option<TextStyle>,
619 pub selection: SelectionStyle,
620}
621
622#[derive(Clone, Deserialize, Default)]
623pub struct CodeActions {
624 #[serde(default)]
625 pub indicator: Color,
626 pub vertical_scale: f32,
627}
628
629#[derive(Clone, Deserialize, Default)]
630pub struct DiffStyle {
631 pub inserted: Color,
632 pub modified: Color,
633 pub deleted: Color,
634 pub removed_width_em: f32,
635 pub width_em: f32,
636 pub corner_radius: f32,
637}
638
639#[derive(Debug, Default, Clone, Copy)]
640pub struct Interactive<T> {
641 pub default: T,
642 pub hover: Option<T>,
643 pub clicked: Option<T>,
644 pub active: Option<T>,
645 pub disabled: Option<T>,
646}
647
648impl<T> Interactive<T> {
649 pub fn style_for(&self, state: &mut MouseState, active: bool) -> &T {
650 if active {
651 self.active.as_ref().unwrap_or(&self.default)
652 } else if state.clicked() == Some(gpui::MouseButton::Left) && self.clicked.is_some() {
653 self.clicked.as_ref().unwrap()
654 } else if state.hovered() {
655 self.hover.as_ref().unwrap_or(&self.default)
656 } else {
657 &self.default
658 }
659 }
660
661 pub fn disabled_style(&self) -> &T {
662 self.disabled.as_ref().unwrap_or(&self.default)
663 }
664}
665
666impl<'de, T: DeserializeOwned> Deserialize<'de> for Interactive<T> {
667 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
668 where
669 D: serde::Deserializer<'de>,
670 {
671 #[derive(Deserialize)]
672 struct Helper {
673 #[serde(flatten)]
674 default: Value,
675 hover: Option<Value>,
676 clicked: Option<Value>,
677 active: Option<Value>,
678 disabled: Option<Value>,
679 }
680
681 let json = Helper::deserialize(deserializer)?;
682
683 let deserialize_state = |state_json: Option<Value>| -> Result<Option<T>, D::Error> {
684 if let Some(mut state_json) = state_json {
685 if let Value::Object(state_json) = &mut state_json {
686 if let Value::Object(default) = &json.default {
687 for (key, value) in default {
688 if !state_json.contains_key(key) {
689 state_json.insert(key.clone(), value.clone());
690 }
691 }
692 }
693 }
694 Ok(Some(
695 serde_json::from_value::<T>(state_json).map_err(serde::de::Error::custom)?,
696 ))
697 } else {
698 Ok(None)
699 }
700 };
701
702 let hover = deserialize_state(json.hover)?;
703 let clicked = deserialize_state(json.clicked)?;
704 let active = deserialize_state(json.active)?;
705 let disabled = deserialize_state(json.disabled)?;
706 let default = serde_json::from_value(json.default).map_err(serde::de::Error::custom)?;
707
708 Ok(Interactive {
709 default,
710 hover,
711 clicked,
712 active,
713 disabled,
714 })
715 }
716}
717
718impl Editor {
719 pub fn replica_selection_style(&self, replica_id: u16) -> &SelectionStyle {
720 let style_ix = replica_id as usize % (self.guest_selections.len() + 1);
721 if style_ix == 0 {
722 &self.selection
723 } else {
724 &self.guest_selections[style_ix - 1]
725 }
726 }
727}
728
729#[derive(Default)]
730pub struct SyntaxTheme {
731 pub highlights: Vec<(String, HighlightStyle)>,
732}
733
734impl SyntaxTheme {
735 pub fn new(highlights: Vec<(String, HighlightStyle)>) -> Self {
736 Self { highlights }
737 }
738}
739
740impl<'de> Deserialize<'de> for SyntaxTheme {
741 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
742 where
743 D: serde::Deserializer<'de>,
744 {
745 let syntax_data: HashMap<String, HighlightStyle> = Deserialize::deserialize(deserializer)?;
746
747 let mut result = Self::new(Vec::new());
748 for (key, style) in syntax_data {
749 match result
750 .highlights
751 .binary_search_by(|(needle, _)| needle.cmp(&key))
752 {
753 Ok(i) | Err(i) => {
754 result.highlights.insert(i, (key, style));
755 }
756 }
757 }
758
759 Ok(result)
760 }
761}
762
763#[derive(Clone, Deserialize, Default)]
764pub struct HoverPopover {
765 pub container: ContainerStyle,
766 pub info_container: ContainerStyle,
767 pub warning_container: ContainerStyle,
768 pub error_container: ContainerStyle,
769 pub block_style: ContainerStyle,
770 pub prose: TextStyle,
771 pub highlight: Color,
772}
773
774#[derive(Clone, Deserialize, Default)]
775pub struct TerminalStyle {
776 pub colors: TerminalColors,
777 pub modal_container: ContainerStyle,
778}
779
780#[derive(Clone, Deserialize, Default)]
781pub struct TerminalColors {
782 pub black: Color,
783 pub red: Color,
784 pub green: Color,
785 pub yellow: Color,
786 pub blue: Color,
787 pub magenta: Color,
788 pub cyan: Color,
789 pub white: Color,
790 pub bright_black: Color,
791 pub bright_red: Color,
792 pub bright_green: Color,
793 pub bright_yellow: Color,
794 pub bright_blue: Color,
795 pub bright_magenta: Color,
796 pub bright_cyan: Color,
797 pub bright_white: Color,
798 pub foreground: Color,
799 pub background: Color,
800 pub modal_background: Color,
801 pub cursor: Color,
802 pub dim_black: Color,
803 pub dim_red: Color,
804 pub dim_green: Color,
805 pub dim_yellow: Color,
806 pub dim_blue: Color,
807 pub dim_magenta: Color,
808 pub dim_cyan: Color,
809 pub dim_white: Color,
810 pub bright_foreground: Color,
811 pub dim_foreground: Color,
812}