summaryrefslogtreecommitdiffstats
path: root/style/src/theme
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-11 03:09:35 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-11 03:09:35 +0100
commit52bd0d41389527d606c2e21cb402b73ca43a713a (patch)
treeec59ee22eee9f726143b0661609763840452a939 /style/src/theme
parent33066bca1af6c67e5188c0481403f28afabcbe1f (diff)
parent9672471d5ca4a92c7f4a636e683961afcfe9421c (diff)
downloadiced-52bd0d41389527d606c2e21cb402b73ca43a713a.tar.gz
iced-52bd0d41389527d606c2e21cb402b73ca43a713a.tar.bz2
iced-52bd0d41389527d606c2e21cb402b73ca43a713a.zip
Merge pull request #2233 from varbhat/vbt/catppuccin
add catppuccin, tokyo night, kanagawa, moonfly, nightfly and oxocarbon themes
Diffstat (limited to 'style/src/theme')
-rw-r--r--style/src/theme/palette.rs219
1 files changed, 207 insertions, 12 deletions
diff --git a/style/src/theme/palette.rs b/style/src/theme/palette.rs
index d5a1a5d9..15a964cd 100644
--- a/style/src/theme/palette.rs
+++ b/style/src/theme/palette.rs
@@ -68,9 +68,9 @@ impl Palette {
),
};
- /// The built-in Dracula variant of a [`Palette`].
+ /// The built-in [Dracula] variant of a [`Palette`].
///
- /// Source: https://draculatheme.com
+ /// [Dracula]: https://draculatheme.com
pub const DRACULA: Self = Self {
background: color!(0x282A36), // BACKGROUND
text: color!(0xf8f8f2), // FOREGROUND
@@ -79,9 +79,9 @@ impl Palette {
danger: color!(0xff5555), // RED
};
- /// The built-in Nord variant of a [`Palette`].
+ /// The built-in [Nord] variant of a [`Palette`].
///
- /// Source: https://www.nordtheme.com/docs/colors-and-palettes
+ /// [Nord]: https://www.nordtheme.com/docs/colors-and-palettes
pub const NORD: Self = Self {
background: color!(0x2e3440), // nord0
text: color!(0xeceff4), // nord6
@@ -90,9 +90,9 @@ impl Palette {
danger: color!(0xbf616a), // nord11
};
- /// The built-in Solarized Light variant of a [`Palette`].
+ /// The built-in [Solarized] Light variant of a [`Palette`].
///
- /// Source: https://ethanschoonover.com/solarized
+ /// [Solarized]: https://ethanschoonover.com/solarized
pub const SOLARIZED_LIGHT: Self = Self {
background: color!(0xfdf6e3), // base3
text: color!(0x657b83), // base00
@@ -101,9 +101,9 @@ impl Palette {
danger: color!(0xdc322f), // red
};
- /// The built-in Solarized Dark variant of a [`Palette`].
+ /// The built-in [Solarized] Dark variant of a [`Palette`].
///
- /// Source: https://ethanschoonover.com/solarized
+ /// [Solarized]: https://ethanschoonover.com/solarized
pub const SOLARIZED_DARK: Self = Self {
background: color!(0x002b36), // base03
text: color!(0x839496), // base0
@@ -112,9 +112,9 @@ impl Palette {
danger: color!(0xdc322f), // red
};
- /// The built-in Gruvbox Light variant of a [`Palette`].
+ /// The built-in [Gruvbox] Light variant of a [`Palette`].
///
- /// Source: https://github.com/morhetz/gruvbox
+ /// [Gruvbox]: https://github.com/morhetz/gruvbox
pub const GRUVBOX_LIGHT: Self = Self {
background: color!(0xfbf1c7), // light BG_0
text: color!(0x282828), // light FG0_29
@@ -123,9 +123,9 @@ impl Palette {
danger: color!(0xcc241d), // light RED_1
};
- /// The built-in Gruvbox Dark variant of a [`Palette`].
+ /// The built-in [Gruvbox] Dark variant of a [`Palette`].
///
- /// Source: https://github.com/morhetz/gruvbox
+ /// [Gruvbox]: https://github.com/morhetz/gruvbox
pub const GRUVBOX_DARK: Self = Self {
background: color!(0x282828), // dark BG_0
text: color!(0xfbf1c7), // dark FG0_29
@@ -133,6 +133,149 @@ impl Palette {
success: color!(0x98971a), // dark GREEN_2
danger: color!(0xcc241d), // dark RED_1
};
+
+ /// The built-in [Catppuccin] Latte variant of a [`Palette`].
+ ///
+ /// [Catppuccin]: https://github.com/catppuccin/catppuccin
+ pub const CATPPUCCIN_LATTE: Self = Self {
+ background: color!(0xeff1f5), // Base
+ text: color!(0x4c4f69), // Text
+ primary: color!(0x1e66f5), // Blue
+ success: color!(0x40a02b), // Green
+ danger: color!(0xd20f39), // Red
+ };
+
+ /// The built-in [Catppuccin] Frappé variant of a [`Palette`].
+ ///
+ /// [Catppuccin]: https://github.com/catppuccin/catppuccin
+ pub const CATPPUCCIN_FRAPPE: Self = Self {
+ background: color!(0x303446), // Base
+ text: color!(0xc6d0f5), // Text
+ primary: color!(0x8caaee), // Blue
+ success: color!(0xa6d189), // Green
+ danger: color!(0xe78284), // Red
+ };
+
+ /// The built-in [Catppuccin] Macchiato variant of a [`Palette`].
+ ///
+ /// [Catppuccin]: https://github.com/catppuccin/catppuccin
+ pub const CATPPUCCIN_MACCHIATO: Self = Self {
+ background: color!(0x24273a), // Base
+ text: color!(0xcad3f5), // Text
+ primary: color!(0x8aadf4), // Blue
+ success: color!(0xa6da95), // Green
+ danger: color!(0xed8796), // Red
+ };
+
+ /// The built-in [Catppuccin] Mocha variant of a [`Palette`].
+ ///
+ /// [Catppuccin]: https://github.com/catppuccin/catppuccin
+ pub const CATPPUCCIN_MOCHA: Self = Self {
+ background: color!(0x1e1e2e), // Base
+ text: color!(0xcdd6f4), // Text
+ primary: color!(0x89b4fa), // Blue
+ success: color!(0xa6e3a1), // Green
+ danger: color!(0xf38ba8), // Red
+ };
+
+ /// The built-in [Tokyo Night] variant of a [`Palette`].
+ ///
+ /// [Tokyo Night]: https://github.com/enkia/tokyo-night-vscode-theme
+ pub const TOKYO_NIGHT: Self = Self {
+ background: color!(0x1a1b26), // Background (Night)
+ text: color!(0x9aa5ce), // Text
+ primary: color!(0x2ac3de), // Blue
+ success: color!(0x9ece6a), // Green
+ danger: color!(0xf7768e), // Red
+ };
+
+ /// The built-in [Tokyo Night] Storm variant of a [`Palette`].
+ ///
+ /// [Tokyo Night]: https://github.com/enkia/tokyo-night-vscode-theme
+ pub const TOKYO_NIGHT_STORM: Self = Self {
+ background: color!(0x24283b), // Background (Storm)
+ text: color!(0x9aa5ce), // Text
+ primary: color!(0x2ac3de), // Blue
+ success: color!(0x9ece6a), // Green
+ danger: color!(0xf7768e), // Red
+ };
+
+ /// The built-in [Tokyo Night] Light variant of a [`Palette`].
+ ///
+ /// [Tokyo Night]: https://github.com/enkia/tokyo-night-vscode-theme
+ pub const TOKYO_NIGHT_LIGHT: Self = Self {
+ background: color!(0xd5d6db), // Background
+ text: color!(0x565a6e), // Text
+ primary: color!(0x166775), // Blue
+ success: color!(0x485e30), // Green
+ danger: color!(0x8c4351), // Red
+ };
+
+ /// The built-in [Kanagawa] Wave variant of a [`Palette`].
+ ///
+ /// [Kanagawa]: 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`].
+ ///
+ /// [Kanagawa]: 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`].
+ ///
+ /// [Kanagawa]: 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`].
+ ///
+ /// [Moonfly]: 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`].
+ ///
+ /// [Nightfly]: 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`].
+ ///
+ /// [Oxocarbon]: 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`].
@@ -184,6 +327,58 @@ pub static EXTENDED_GRUVBOX_LIGHT: Lazy<Extended> =
pub static EXTENDED_GRUVBOX_DARK: Lazy<Extended> =
Lazy::new(|| Extended::generate(Palette::GRUVBOX_DARK));
+/// The built-in Catppuccin Latte variant of an [`Extended`] palette.
+pub static EXTENDED_CATPPUCCIN_LATTE: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_LATTE));
+
+/// The built-in Catppuccin Frappé variant of an [`Extended`] palette.
+pub static EXTENDED_CATPPUCCIN_FRAPPE: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_FRAPPE));
+
+/// The built-in Catppuccin Macchiato variant of an [`Extended`] palette.
+pub static EXTENDED_CATPPUCCIN_MACCHIATO: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_MACCHIATO));
+
+/// The built-in Catppuccin Mocha variant of an [`Extended`] palette.
+pub static EXTENDED_CATPPUCCIN_MOCHA: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_MOCHA));
+
+/// The built-in Tokyo Night variant of an [`Extended`] palette.
+pub static EXTENDED_TOKYO_NIGHT: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT));
+
+/// The built-in Tokyo Night Storm variant of an [`Extended`] palette.
+pub static EXTENDED_TOKYO_NIGHT_STORM: Lazy<Extended> =
+ Lazy::new(|| Extended::generate(Palette::TOKYO_NIGHT_STORM));
+
+/// The built-in Tokyo Night variant of an [`Extended`] palette.
+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 {