* feat(status-bar): add draft for multiple tips * feat: add TIPS_MAP * Simplified 'tip' function. * chore: update file structure * feat(status-bar): update method of Tip rendering * feat(status-bar): change type of tip in State * refactor(status-bar): related to random tip selection * feat(status-bar): add simple local cache for testing * feat(status-bar): add cache system for tip data * Add mpadir to wasm for plugin to access zellij temp folder. * refactor(status-bar): update cache and utils * fix(status-bar): update file read error * refactor(status-bar): update macros * chore(status-bar): delete test data * chore(status-bar): update missing fixes * feat(status-bar): add detailed error * style: make clippy
31 lines
872 B
Rust
31 lines
872 B
Rust
#[macro_export]
|
|
macro_rules! rgb {
|
|
($a:expr) => {
|
|
ansi_term::Color::Rgb($a.0, $a.1, $a.2)
|
|
};
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! palette_match {
|
|
($palette_color:expr) => {
|
|
match $palette_color {
|
|
PaletteColor::Rgb((r, g, b)) => RGB(r, g, b),
|
|
PaletteColor::EightBit(color) => Fixed(color),
|
|
}
|
|
};
|
|
}
|
|
|
|
#[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),
|
|
})
|
|
};
|
|
}
|