macro_rules! hexbg {
($hex:expr) => { ... };
($hex:expr, $r:expr) => { ... };
($hex:expr, $r:expr, $g:expr, $b:expr) => { ... };
}Expand description
hexbg! macro to convert hex color to ansi background color example: hexbg!(#0099FF) -> “\x1b[48;2;0;99;255m\x1b[30m” example: hexbg!(#0099FF, 255) -> “\x1b[48;2;0;99;255m\x1b[30m” example: hexbg!(#0099FF, 255, 255, 255) -> “\x1b[48;2;0;99;255m\x1b[30m”