summaryrefslogtreecommitdiffstats
path: root/style/src/theme.rs
diff options
context:
space:
mode:
authorLibravatar Var Bhat <mailvarbhat@gmail.com>2024-02-04 00:07:16 +0530
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-11 02:50:38 +0100
commit4503e2ba7e1c124798f36849d0f64a31b2e5c9a5 (patch)
treeb9be7b8e290d749d663746acf94b7bc50f97794f /style/src/theme.rs
parent3513a4ad5612b6659ab037b0c1b0c22e5cabc1f5 (diff)
downloadiced-4503e2ba7e1c124798f36849d0f64a31b2e5c9a5.tar.gz
iced-4503e2ba7e1c124798f36849d0f64a31b2e5c9a5.tar.bz2
iced-4503e2ba7e1c124798f36849d0f64a31b2e5c9a5.zip
add tokyo night themes and palettes
Source: https://github.com/enkia/tokyo-night-vscode-theme
Diffstat (limited to 'style/src/theme.rs')
-rw-r--r--style/src/theme.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs
index ad95ff0f..20ac9343 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -56,6 +56,12 @@ pub enum Theme {
CatppuccinMacchiato,
/// The built-in Catppuccin Mocha variant.
CatppuccinMocha,
+ /// The built-in Tokyo Night variant.
+ TokyoNight,
+ /// The built-in Tokyo Night Storm variant.
+ TokyoNightStorm,
+ /// The built-in Tokyo Night Light variant.
+ TokyoNightLight,
/// A [`Theme`] that uses a [`Custom`] palette.
Custom(Arc<Custom>),
}
@@ -75,6 +81,9 @@ impl Theme {
Self::CatppuccinFrappe,
Self::CatppuccinMacchiato,
Self::CatppuccinMocha,
+ Self::TokyoNight,
+ Self::TokyoNightStorm,
+ Self::TokyoNightLight,
];
/// Creates a new custom [`Theme`] from the given [`Palette`].
@@ -107,6 +116,9 @@ impl Theme {
Self::CatppuccinFrappe => Palette::CATPPUCCIN_FRAPPE,
Self::CatppuccinMacchiato => Palette::CATPPUCCIN_MACCHIATO,
Self::CatppuccinMocha => Palette::CATPPUCCIN_MOCHA,
+ Self::TokyoNight => Palette::TOKYO_NIGHT,
+ Self::TokyoNightStorm => Palette::TOKYO_NIGHT_STORM,
+ Self::TokyoNightLight => Palette::TOKYO_NIGHT_LIGHT,
Self::Custom(custom) => custom.palette,
}
}
@@ -128,6 +140,9 @@ impl Theme {
&palette::EXTENDED_CATPPUCCIN_MACCHIATO
}
Self::CatppuccinMocha => &palette::EXTENDED_CATPPUCCIN_MOCHA,
+ Self::TokyoNight => &palette::EXTENDED_TOKYO_NIGHT,
+ Self::TokyoNightStorm => &palette::EXTENDED_TOKYO_NIGHT_STORM,
+ Self::TokyoNightLight => &palette::EXTENDED_TOKYO_NIGHT_LIGHT,
Self::Custom(custom) => &custom.extended,
}
}
@@ -148,6 +163,9 @@ impl fmt::Display for Theme {
Self::CatppuccinFrappe => write!(f, "Catppuccin Frappé"),
Self::CatppuccinMacchiato => write!(f, "Catppuccin Macchiato"),
Self::CatppuccinMocha => write!(f, "Catppuccin Mocha"),
+ Self::TokyoNight => write!(f, "Tokyo Night"),
+ Self::TokyoNightStorm => write!(f, "Tokyo Night Storm"),
+ Self::TokyoNightLight => write!(f, "Tokyo Night Light"),
Self::Custom(custom) => custom.fmt(f),
}
}