zellij/zellij-tile-extra/src/lib.rs
Aram Drevekenin 1f88b342e2
fix(colors): stabilize colors (#453)
* fix(colors): stabilize colors

* style(fmt): rustfmt
2021-05-04 16:06:55 +02:00

21 lines
628 B
Rust

#[macro_export]
macro_rules! rgb {
($a:expr) => {
ansi_term::Color::Rgb($a.0, $a.1, $a.2)
};
}
#[macro_export]
macro_rules! style {
($fg:expr, $bg:expr) => {
ansi_term::Style::new()
.fg(match $fg {
PaletteColor::Rgb((r, g, b)) => ansi_term::Color::RGB(r, g, b),
PaletteColor::EightBit(color) => ansi_term::Color::Fixed(color),
})
.on(match $bg {
PaletteColor::Rgb((r, g, b)) => ansi_term::Color::RGB(r, g, b),
PaletteColor::EightBit(color) => ansi_term::Color::Fixed(color),
})
};
}