default_theme.rs

 1use std::sync::Arc;
 2
 3use crate::{
 4    default_color_scales,
 5    one_themes::{one_dark, one_family},
 6    Appearance, PlayerColors, StatusColors, SyntaxTheme, SystemColors, Theme, ThemeColors,
 7    ThemeFamily, ThemeStyles,
 8};
 9
10fn zed_pro_daylight() -> Theme {
11    Theme {
12        id: "zed_pro_daylight".to_string(),
13        name: "Zed Pro Daylight".into(),
14        appearance: Appearance::Light,
15        styles: ThemeStyles {
16            system: SystemColors::default(),
17            colors: ThemeColors::light(),
18            status: StatusColors::light(),
19            player: PlayerColors::light(),
20            syntax: Arc::new(SyntaxTheme::light()),
21        },
22    }
23}
24
25pub(crate) fn zed_pro_moonlight() -> Theme {
26    Theme {
27        id: "zed_pro_moonlight".to_string(),
28        name: "Zed Pro Moonlight".into(),
29        appearance: Appearance::Dark,
30        styles: ThemeStyles {
31            system: SystemColors::default(),
32            colors: ThemeColors::dark(),
33            status: StatusColors::dark(),
34            player: PlayerColors::dark(),
35            syntax: Arc::new(SyntaxTheme::dark()),
36        },
37    }
38}
39
40pub fn zed_pro_family() -> ThemeFamily {
41    ThemeFamily {
42        id: "zed_pro".to_string(),
43        name: "Zed Pro".into(),
44        author: "Zed Team".into(),
45        themes: vec![zed_pro_daylight(), zed_pro_moonlight()],
46        scales: default_color_scales(),
47    }
48}
49
50impl Default for ThemeFamily {
51    fn default() -> Self {
52        one_family()
53    }
54}
55
56impl Default for Theme {
57    fn default() -> Self {
58        one_dark()
59    }
60}