#[macro_export]
macro_rules! choose_apply_style {
($fg: expr => fg) => {
SetForegroundColor($crate::convert_from_tui_color_to_crossterm_color($fg))
};
($bg: expr => bg) => {
SetBackgroundColor($crate::convert_from_tui_color_to_crossterm_color($bg))
};
($style: expr => bold) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.bold.is_some() {
true => SetAttribute(Attribute::Bold),
false => SetAttribute(Attribute::NoBold),
}
}};
($style: expr => italic) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.italic.is_some() {
true => SetAttribute(Attribute::Italic),
false => SetAttribute(Attribute::NoItalic),
}
}};
($style: expr => dim) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.dim.is_some() {
true => SetAttribute(Attribute::Dim),
false => SetAttribute(Attribute::NormalIntensity),
}
}};
($style: expr => underline) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.underline.is_some() {
true => SetAttribute(Attribute::Underlined),
false => SetAttribute(Attribute::NoUnderline),
}
}};
($style: expr => reverse) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.reverse.is_some() {
true => SetAttribute(Attribute::Reverse),
false => SetAttribute(Attribute::NoReverse),
}
}};
($style: expr => hidden) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.hidden.is_some() {
true => SetAttribute(Attribute::Hidden),
false => SetAttribute(Attribute::NoHidden),
}
}};
($style: expr => strikethrough) => {{
use crossterm::style::{Attribute, SetAttribute};
match $style.strikethrough.is_some() {
true => SetAttribute(Attribute::CrossedOut),
false => SetAttribute(Attribute::NotCrossedOut),
}
}};
}