macro_rules! wcs {
($buf:expr, $($font:expr),* ; $($arg:tt)*) => { ... };
($buf:expr, $($($font:expr),* => $($s:expr),* );* $(;)?) => { ... };
}Expand description
write_color_string 写入彩色字符串
§Examples
use color_string::wcs;
use color_string::Font::*;
let mut s = String::new();
wcs!(&mut s, Red, Bold; "{:X}", u32::MAX);
println!("{s}");
assert_eq!("\u{1b}[31;1mFFFFFFFF\u{1b}[0m", s);
let mut s = String::new();
wcs!{
&mut s,
Red => 123456, "\n";
Green,Bold => "hello world";
}
println!("{s}");
assert_eq!("\u{1b}[31m123456\n\u{1b}[32;1mhello world\u{1b}[0m", s);