feat: change light mode surface color
This commit is contained in:
96
src/theme.rs
96
src/theme.rs
@@ -52,20 +52,20 @@ impl ThemeFamily {
|
|||||||
|
|
||||||
pub const fn id(self) -> &'static str {
|
pub const fn id(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::Catppuccin => "catppuccin",
|
| Self::Catppuccin => "catppuccin",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn label(self) -> &'static str {
|
pub const fn label(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::Catppuccin => "Catppuccin",
|
| Self::Catppuccin => "Catppuccin",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn variant(self, mode: ThemeMode) -> ThemeVariant {
|
pub const fn variant(self, mode: ThemeMode) -> ThemeVariant {
|
||||||
match (self, mode) {
|
match (self, mode) {
|
||||||
(Self::Catppuccin, ThemeMode::Light) => ThemeVariant::CatppuccinLatte,
|
| (Self::Catppuccin, ThemeMode::Light) => ThemeVariant::CatppuccinLatte,
|
||||||
(Self::Catppuccin, ThemeMode::Dark) => ThemeVariant::CatppuccinMocha,
|
| (Self::Catppuccin, ThemeMode::Dark) => ThemeVariant::CatppuccinMocha,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,64 +92,64 @@ impl ThemeVariant {
|
|||||||
|
|
||||||
pub const fn family(self) -> ThemeFamily {
|
pub const fn family(self) -> ThemeFamily {
|
||||||
match self {
|
match self {
|
||||||
Self::CatppuccinLatte | Self::CatppuccinMocha => ThemeFamily::Catppuccin,
|
| Self::CatppuccinLatte | Self::CatppuccinMocha => ThemeFamily::Catppuccin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn mode(self) -> ThemeMode {
|
pub const fn mode(self) -> ThemeMode {
|
||||||
match self {
|
match self {
|
||||||
Self::CatppuccinLatte => ThemeMode::Light,
|
| Self::CatppuccinLatte => ThemeMode::Light,
|
||||||
Self::CatppuccinMocha => ThemeMode::Dark,
|
| Self::CatppuccinMocha => ThemeMode::Dark,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn label(self) -> &'static str {
|
pub const fn label(self) -> &'static str {
|
||||||
match self {
|
match self {
|
||||||
Self::CatppuccinLatte => "Catppuccin Latte",
|
| Self::CatppuccinLatte => "Catppuccin Latte",
|
||||||
Self::CatppuccinMocha => "Catppuccin Mocha",
|
| Self::CatppuccinMocha => "Catppuccin Mocha",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn theme(self) -> Theme {
|
pub const fn theme(self) -> Theme {
|
||||||
match self {
|
match self {
|
||||||
Self::CatppuccinLatte => Theme {
|
| Self::CatppuccinLatte => Theme {
|
||||||
id: "catppuccin-latte",
|
id: "catppuccin-latte",
|
||||||
name: "Catppuccin Latte",
|
name: "Catppuccin Latte",
|
||||||
mode: ThemeMode::Light,
|
mode: ThemeMode::Light,
|
||||||
colors: ThemeColors {
|
colors: ThemeColors {
|
||||||
background: hex(0xeff1f5),
|
background: hex(0xeff1f5),
|
||||||
surface: hex(0xe6e9ef),
|
surface: hex(0xeff1f5),
|
||||||
surface_elevated: hex(0xdce0e8),
|
surface_elevated: hex(0xdce0e8),
|
||||||
border: hex(0xccd0da),
|
border: hex(0xccd0da),
|
||||||
text: hex(0x4c4f69),
|
text: hex(0x4c4f69),
|
||||||
text_muted: hex(0x6c6f85),
|
text_muted: hex(0x6c6f85),
|
||||||
accent: hex(0x8839ef),
|
accent: hex(0x8839ef),
|
||||||
accent_hover: hex(0x7287fd),
|
accent_hover: hex(0x7287fd),
|
||||||
accent_text: hex(0xeff1f5),
|
accent_text: hex(0xeff1f5),
|
||||||
success: hex(0x40a02b),
|
success: hex(0x40a02b),
|
||||||
warning: hex(0xdf8e1d),
|
warning: hex(0xdf8e1d),
|
||||||
danger: hex(0xd20f39),
|
danger: hex(0xd20f39),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Self::CatppuccinMocha => Theme {
|
},
|
||||||
id: "catppuccin-mocha",
|
| Self::CatppuccinMocha => Theme {
|
||||||
name: "Catppuccin Mocha",
|
id: "catppuccin-mocha",
|
||||||
mode: ThemeMode::Dark,
|
name: "Catppuccin Mocha",
|
||||||
colors: ThemeColors {
|
mode: ThemeMode::Dark,
|
||||||
background: hex(0x1e1e2e),
|
colors: ThemeColors {
|
||||||
surface: hex(0x181825),
|
background: hex(0x1e1e2e),
|
||||||
surface_elevated: hex(0x313244),
|
surface: hex(0x181825),
|
||||||
border: hex(0x45475a),
|
surface_elevated: hex(0x313244),
|
||||||
text: hex(0xcdd6f4),
|
border: hex(0x45475a),
|
||||||
text_muted: hex(0xa6adc8),
|
text: hex(0xcdd6f4),
|
||||||
accent: hex(0xcba6f7),
|
text_muted: hex(0xa6adc8),
|
||||||
accent_hover: hex(0xb4befe),
|
accent: hex(0xcba6f7),
|
||||||
accent_text: hex(0x1e1e2e),
|
accent_hover: hex(0xb4befe),
|
||||||
success: hex(0xa6e3a1),
|
accent_text: hex(0x1e1e2e),
|
||||||
warning: hex(0xf9e2af),
|
success: hex(0xa6e3a1),
|
||||||
danger: hex(0xf38ba8),
|
warning: hex(0xf9e2af),
|
||||||
},
|
danger: hex(0xf38ba8),
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,10 +157,8 @@ impl ThemeVariant {
|
|||||||
impl From<gpui::WindowAppearance> for ThemeMode {
|
impl From<gpui::WindowAppearance> for ThemeMode {
|
||||||
fn from(value: gpui::WindowAppearance) -> Self {
|
fn from(value: gpui::WindowAppearance) -> Self {
|
||||||
match value {
|
match value {
|
||||||
gpui::WindowAppearance::Light | gpui::WindowAppearance::VibrantLight => {
|
| gpui::WindowAppearance::Light | gpui::WindowAppearance::VibrantLight => ThemeMode::Light,
|
||||||
ThemeMode::Light
|
| gpui::WindowAppearance::Dark | gpui::WindowAppearance::VibrantDark => ThemeMode::Dark,
|
||||||
}
|
|
||||||
gpui::WindowAppearance::Dark | gpui::WindowAppearance::VibrantDark => ThemeMode::Dark,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user