summaryrefslogtreecommitdiffstats
path: root/style/src/theme.rs
diff options
context:
space:
mode:
authorLibravatar Var Bhat <mailvarbhat@gmail.com>2023-12-22 02:10:53 +0530
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-03 18:29:25 +0100
commit04b9dc4e2de4d36c2de7d537bb71694278bb79f0 (patch)
treeee32ff768ce85b9eabbb94acec7d643b083962d5 /style/src/theme.rs
parent6492d9d92793fca74adbc6aaaa8341e3ff4d37ab (diff)
downloadiced-04b9dc4e2de4d36c2de7d537bb71694278bb79f0.tar.gz
iced-04b9dc4e2de4d36c2de7d537bb71694278bb79f0.tar.bz2
iced-04b9dc4e2de4d36c2de7d537bb71694278bb79f0.zip
Add Dracula, Nord, Solarized and Grubvox variants to `Theme`
Diffstat (limited to 'style/src/theme.rs')
-rw-r--r--style/src/theme.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 166410ae..b1902b06 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -34,6 +34,18 @@ pub enum Theme {
Light,
/// The built-in dark variant.
Dark,
+ /// The built-in dracula variant.
+ Dracula,
+ /// The built-in nord variant.
+ Nord,
+ /// The built-in solarized light variant.
+ SolarizedLight,
+ /// The built-in solarized dark variant.
+ SolarizedDark,
+ /// The built-in gruvbox light variant.
+ GruvboxLight,
+ /// The built-in gruvbox dark variant.
+ GruvboxDark,
/// A [`Theme`] that uses a [`Custom`] palette.
Custom(Box<Custom>),
}
@@ -62,6 +74,12 @@ impl Theme {
match self {
Self::Light => Palette::LIGHT,
Self::Dark => Palette::DARK,
+ Self::Dracula => Palette::DRACULA,
+ Self::Nord => Palette::NORD,
+ Self::SolarizedLight => Palette::SOLARIZED_LIGHT,
+ Self::SolarizedDark => Palette::SOLARIZED_DARK,
+ Self::GruvboxLight => Palette::GRUVBOX_LIGHT,
+ Self::GruvboxDark => Palette::GRUVBOX_DARK,
Self::Custom(custom) => custom.palette,
}
}
@@ -71,6 +89,12 @@ impl Theme {
match self {
Self::Light => &palette::EXTENDED_LIGHT,
Self::Dark => &palette::EXTENDED_DARK,
+ Self::Dracula => &palette::EXTENDED_DRACULA,
+ Self::Nord => &palette::EXTENDED_NORD,
+ Self::SolarizedLight => &palette::EXTENDED_SOLARIZED_LIGHT,
+ Self::SolarizedDark => &palette::EXTENDED_SOLARIZED_DARK,
+ Self::GruvboxLight => &palette::EXTENDED_GRUVBOX_LIGHT,
+ Self::GruvboxDark => &palette::EXTENDED_GRUVBOX_DARK,
Self::Custom(custom) => &custom.extended,
}
}
@@ -81,6 +105,12 @@ impl fmt::Display for Theme {
match self {
Self::Light => write!(f, "Light"),
Self::Dark => write!(f, "Dark"),
+ Self::Dracula => write!(f, "Dracula"),
+ Self::Nord => write!(f, "Nord"),
+ Self::SolarizedLight => write!(f, "Solarized Light"),
+ Self::SolarizedDark => write!(f, "Solarized Dark"),
+ Self::GruvboxLight => write!(f, "Gruvbox Light"),
+ Self::GruvboxDark => write!(f, "Gruvbox Dark"),
Self::Custom(custom) => custom.fmt(f),
}
}