add tokyo night themes and palettes
Source: https://github.com/enkia/tokyo-night-vscode-theme
This commit is contained in:
parent
3513a4ad56
commit
4503e2ba7e
2 changed files with 63 additions and 0 deletions
|
|
@ -56,6 +56,12 @@ pub enum Theme {
|
||||||
CatppuccinMacchiato,
|
CatppuccinMacchiato,
|
||||||
/// The built-in Catppuccin Mocha variant.
|
/// The built-in Catppuccin Mocha variant.
|
||||||
CatppuccinMocha,
|
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.
|
/// A [`Theme`] that uses a [`Custom`] palette.
|
||||||
Custom(Arc<Custom>),
|
Custom(Arc<Custom>),
|
||||||
}
|
}
|
||||||
|
|
@ -75,6 +81,9 @@ impl Theme {
|
||||||
Self::CatppuccinFrappe,
|
Self::CatppuccinFrappe,
|
||||||
Self::CatppuccinMacchiato,
|
Self::CatppuccinMacchiato,
|
||||||
Self::CatppuccinMocha,
|
Self::CatppuccinMocha,
|
||||||
|
Self::TokyoNight,
|
||||||
|
Self::TokyoNightStorm,
|
||||||
|
Self::TokyoNightLight,
|
||||||
];
|
];
|
||||||
|
|
||||||
/// Creates a new custom [`Theme`] from the given [`Palette`].
|
/// Creates a new custom [`Theme`] from the given [`Palette`].
|
||||||
|
|
@ -107,6 +116,9 @@ impl Theme {
|
||||||
Self::CatppuccinFrappe => Palette::CATPPUCCIN_FRAPPE,
|
Self::CatppuccinFrappe => Palette::CATPPUCCIN_FRAPPE,
|
||||||
Self::CatppuccinMacchiato => Palette::CATPPUCCIN_MACCHIATO,
|
Self::CatppuccinMacchiato => Palette::CATPPUCCIN_MACCHIATO,
|
||||||
Self::CatppuccinMocha => Palette::CATPPUCCIN_MOCHA,
|
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,
|
Self::Custom(custom) => custom.palette,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,6 +140,9 @@ impl Theme {
|
||||||
&palette::EXTENDED_CATPPUCCIN_MACCHIATO
|
&palette::EXTENDED_CATPPUCCIN_MACCHIATO
|
||||||
}
|
}
|
||||||
Self::CatppuccinMocha => &palette::EXTENDED_CATPPUCCIN_MOCHA,
|
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,
|
Self::Custom(custom) => &custom.extended,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -148,6 +163,9 @@ impl fmt::Display for Theme {
|
||||||
Self::CatppuccinFrappe => write!(f, "Catppuccin Frappé"),
|
Self::CatppuccinFrappe => write!(f, "Catppuccin Frappé"),
|
||||||
Self::CatppuccinMacchiato => write!(f, "Catppuccin Macchiato"),
|
Self::CatppuccinMacchiato => write!(f, "Catppuccin Macchiato"),
|
||||||
Self::CatppuccinMocha => write!(f, "Catppuccin Mocha"),
|
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),
|
Self::Custom(custom) => custom.fmt(f),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,39 @@ impl Palette {
|
||||||
success: color!(0xa6e3a1), // Green
|
success: color!(0xa6e3a1), // Green
|
||||||
danger: color!(0xf38ba8), // Red
|
danger: color!(0xf38ba8), // Red
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// The built-in Tokyo Night variant of a [`Palette`].
|
||||||
|
///
|
||||||
|
/// Source: 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`].
|
||||||
|
///
|
||||||
|
/// Source: 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`].
|
||||||
|
///
|
||||||
|
/// Source: 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
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An extended set of colors generated from a [`Palette`].
|
/// An extended set of colors generated from a [`Palette`].
|
||||||
|
|
@ -244,6 +277,18 @@ pub static EXTENDED_CATPPUCCIN_MACCHIATO: Lazy<Extended> =
|
||||||
pub static EXTENDED_CATPPUCCIN_MOCHA: Lazy<Extended> =
|
pub static EXTENDED_CATPPUCCIN_MOCHA: Lazy<Extended> =
|
||||||
Lazy::new(|| Extended::generate(Palette::CATPPUCCIN_MOCHA));
|
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));
|
||||||
|
|
||||||
impl Extended {
|
impl Extended {
|
||||||
/// Generates an [`Extended`] palette from a simple [`Palette`].
|
/// Generates an [`Extended`] palette from a simple [`Palette`].
|
||||||
pub fn generate(palette: Palette) -> Self {
|
pub fn generate(palette: Palette) -> Self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue