theme.rs

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