summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Var Bhat <mailvarbhat@gmail.com>2024-02-04 01:01:02 +0530
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-11 02:50:38 +0100
commitd5466c1861157ba5a70d7fa7b818cebe11dedbc3 (patch)
tree6a2e8cf04e8e9c6999f17896795f32c6e537ce87 /style
parent4503e2ba7e1c124798f36849d0f64a31b2e5c9a5 (diff)
downloadiced-d5466c1861157ba5a70d7fa7b818cebe11dedbc3.tar.gz
iced-d5466c1861157ba5a70d7fa7b818cebe11dedbc3.tar.bz2
iced-d5466c1861157ba5a70d7fa7b818cebe11dedbc3.zip
Add Kanagawa, Moonfly, Nightfly, Oxocarbon themes
Diffstat (limited to 'style')
-rw-r--r--style/src/theme.rs36
-rw-r--r--style/src/theme/palette.rs90
2 files changed, 126 insertions, 0 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 20ac9343..5909498f 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -62,6 +62,18 @@ pub enum Theme {
TokyoNightStorm,
/// The built-in Tokyo Night Light variant.
TokyoNightLight,
+ /// The built-in Kanagawa Wave variant.
+ KanagawaWave,
+ /// The built-in Kanagawa Dragon variant.
+ KanagawaDragon,
+ /// The built-in Kanagawa Lotus variant.
+ KanagawaLotus,
+ /// The built-in Moonfly variant.
+ Moonfly,
+ /// The built-in Nightfly variant.
+ Nightfly,
+ /// The built-in Oxocarbon variant.
+ Oxocarbon,
/// A [`Theme`] that uses a [`Custom`] palette.
Custom(Arc<Custom>),
}
@@ -84,6 +96,12 @@ impl Theme {
Self::TokyoNight,
Self::TokyoNightStorm,
Self::TokyoNightLight,
+ Self::KanagawaWave,
+ Self::KanagawaDragon,
+ Self::KanagawaLotus,
+ Self::Moonfly,
+ Self::Nightfly,
+ Self::Oxocarbon,
];
/// Creates a new custom [`Theme`] from the given [`Palette`].
@@ -119,6 +137,12 @@ impl Theme {
Self::TokyoNight => Palette::TOKYO_NIGHT,
Self::TokyoNightStorm => Palette::TOKYO_NIGHT_STORM,
Self::TokyoNightLight => Palette::TOKYO_NIGHT_LIGHT,
+ Self::KanagawaWave => Palette::KANAGAWA_WAVE,
+ Self::KanagawaDragon => Palette::KANAGAWA_DRAGON,
+ Self::KanagawaLotus => Palette::KANAGAWA_LOTUS,
+ Self::Moonfly => Palette::MOONFLY,
+ Self::Nightfly => Palette::NIGHTFLY,
+ Self::Oxocarbon => Palette::OXOCARBON,
Self::Custom(custom) => custom.palette,
}
}
@@ -143,6 +167,12 @@ impl Theme {
Self::TokyoNight => &palette::EXTENDED_TOKYO_NIGHT,
Self::TokyoNightStorm => &palette::EXTENDED_TOKYO_NIGHT_STORM,
Self::TokyoNightLight => &palette::EXTENDED_TOKYO_NIGHT_LIGHT,
+ Self::KanagawaWave => &palette::EXTENDED_KANAGAWA_WAVE,
+ Self::KanagawaDragon => &palette::EXTENDED_KANAGAWA_DRAGON,
+ Self::KanagawaLotus => &palette::EXTENDED_KANAGAWA_LOTUS,
+ Self::Moonfly => &palette::EXTENDED_MOONFLY,
+ Self::Nightfly => &palette::EXTENDED_NIGHTFLY,
+ Self::Oxocarbon => &palette::EXTENDED_OXOCARBON,
Self::Custom(custom) => &custom.extended,
}
}
@@ -166,6 +196,12 @@ impl fmt::Display for Theme {
Self::TokyoNight => write!(f, "Tokyo Night"),
Self::TokyoNightStorm => write!(f, "Tokyo Night Storm"),
Self::TokyoNightLight => write!(f, "Tokyo Night Light"),
+ Self::KanagawaWave => write!(f, "Kanagawa Wave"),
+ Self::KanagawaDragon => write!(f, "Kanagawa Dragon"),
+ Self::KanagawaLotus => write!(f, "Kanagawa Lotus"),
+ Self::Moonfly => write!(f, "Moonfly"),
+ Self::Nightfly => write!(f, "Nightfly"),
+ Self::Oxocarbon => write!(f, "Oxocarbon"),
Self::Custom(custom) => custom.fmt(f),
}
}
diff --git a/style/src/theme/palette.rs b/style/src/theme/palette.rs
index f2d1567e..ffa5c78b 100644
--- a/style/src/theme/palette.rs
+++ b/style/src/theme/palette.rs
@@ -210,6 +210,72 @@ impl Palette {
success: color!(0x485e30), // Green
danger: color!(0x8c4351), // Red
};
+
+ /// The built-in Kanagawa Wave variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/rebelot/kanagawa.nvim
+ pub const KANAGAWA_WAVE: Self = Self {
+ background: color!(0x363646), // Sumi Ink 3
+ text: color!(0xCD7BA), // Fuji White
+ primary: color!(0x2D4F67), // Wave Blue 2
+ success: color!(0x76946A), // Autumn Green
+ danger: color!(0xC34043), // Autumn Red
+ };
+
+ /// The built-in Kanagawa Dragon variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/rebelot/kanagawa.nvim
+ pub const KANAGAWA_DRAGON: Self = Self {
+ background: color!(0x181616), // Dragon Black 3
+ text: color!(0xc5c9c5), // Dragon White
+ primary: color!(0x223249), // Wave Blue 1
+ success: color!(0x8a9a7b), // Dragon Green 2
+ danger: color!(0xc4746e), // Dragon Red
+ };
+
+ /// The built-in Kanagawa Lotus variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/rebelot/kanagawa.nvim
+ pub const KANAGAWA_LOTUS: Self = Self {
+ background: color!(0xf2ecbc), // Lotus White 3
+ text: color!(0x545464), // Lotus Ink 1
+ primary: color!(0xc9cbd1), // Lotus Violet 3
+ success: color!(0x6f894e), // Lotus Green
+ danger: color!(0xc84053), // Lotus Red
+ };
+
+ /// The built-in Moonfly variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/bluz71/vim-moonfly-colors
+ pub const MOONFLY: Self = Self {
+ background: color!(0x080808), // Background
+ text: color!(0xbdbdbd), // Foreground
+ primary: color!(0x80a0ff), // Blue (normal)
+ success: color!(0x8cc85f), // Green (normal)
+ danger: color!(0xff5454), // Red (normal)
+ };
+
+ /// The built-in Nightfly variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/bluz71/vim-nightfly-colors
+ pub const NIGHTFLY: Self = Self {
+ background: color!(0x011627), // Background
+ text: color!(0xbdc1c6), // Foreground
+ primary: color!(0x82aaff), // Blue (normal)
+ success: color!(0xa1cd5e), // Green (normal)
+ danger: color!(0xfc514e), // Red (normal)
+ };
+
+ /// The built-in Oxocarbon variant of a [`Palette`].
+ ///
+ /// Source: https://github.com/nyoom-engineering/oxocarbon.nvim
+ pub const OXOCARBON: Self = Self {
+ background: color!(0x232323),
+ text: color!(0xd0d0d0),
+ primary: color!(0x00b4ff),
+ success: color!(0x00c15a),
+ danger: color!(0xf62d0f),
+ };
}
/// An extended set of colors generated from a [`Palette`].
@@ -289,6 +355,30 @@ pub static EXTENDED_TOKYO_NIGHT_STORM: Lazy<Extended> =
pub static EXTENDED_TOKYO_NIGHT_LIGHT: Lazy<Extended> =
Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT_LIGHT));
+/// The built-in Kanagawa Wave variant of an [`Extended`] palette.
+pub static EXTENDED_KANAGAWA_WAVE: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::KANAGAWA_WAVE));
+
+/// The built-in Kanagawa Dragon variant of an [`Extended`] palette.
+pub static EXTENDED_KANAGAWA_DRAGON: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::KANAGAWA_DRAGON));
+
+/// The built-in Kanagawa Lotus variant of an [`Extended`] palette.
+pub static EXTENDED_KANAGAWA_LOTUS: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::KANAGAWA_LOTUS));
+
+/// The built-in Moonfly variant of an [`Extended`] palette.
+pub static EXTENDED_MOONFLY: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::MOONFLY));
+
+/// The built-in Nightfly variant of an [`Extended`] palette.
+pub static EXTENDED_NIGHTFLY: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::NIGHTFLY));
+
+/// The built-in Oxocarbon variant of an [`Extended`] palette.
+pub static EXTENDED_OXOCARBON: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::OXOCARBON));
+
impl Extended {
/// Generates an [`Extended`] palette from a simple [`Palette`].
pub fn generate(palette: Palette) -> Self {