Debian Codegraph @

src/options/config/style/themes.rs

raw symbols SCIP
1 //! A set of pre-defined themes.
2
3 pub(super) mod default;
4 pub(super) mod gruvbox;
5 pub(super) mod nord;
6
7 /// Convert a [`ratatui::style::Color`] into a [`ratatui::style::Style`] with the colour
8 /// as the foreground.
9 macro_rules! colour {
10 ($value:expr) => {
11 ratatui::style::Style::new().fg($value)
12 };
13 }
14
15 /// Convert a hex string to a [`ratatui::style::Style`], where the hex string is
16 /// used as the foreground colour.
17 macro_rules! hex {
18 ($value:literal) => {
19 ratatui::style::Style::new().fg(crate::options::config::style::utils::try_hex_to_colour(
20 $value.into(),
21 )
22 .expect("valid hex"))
23 };
24 }
25
26 /// Convert a hex string to a [`ratatui::style::Color`].
27 macro_rules! hex_colour {
28 ($value:literal) => {
29 crate::options::config::style::utils::try_hex_to_colour($value.into()).expect("valid hex")
30 };
31 }
32
33 pub(super) use colour;
34 pub(super) use hex;
35 pub(super) use hex_colour;