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