macro_rules! fonts { ($ ($font:expr),*) => { ... }; }
组合多种字体
use color_string::fonts; use color_string::Font::*; let fonts = fonts!(Red, Bold, Underline, BgColor(1, 2, 3)); assert_eq!("\x1b[31;1;4;48;2;1;2;3m", fonts)