[][src]Macro bunt::style

style!() { /* proc-macro */ }

Parses the given style specification string and returns the corresponding termcolor::ColorSpec value.

use bunt::termcolor::{Color, ColorChoice, StandardStream, WriteColor};

let style = bunt::style!("red+bold+bg:yellow");
let mut stdout = StandardStream::stdout(ColorChoice::Auto);
stdout.set_color(&style)?;

assert_eq!(style.fg(), Some(&Color::Red));
assert_eq!(style.bg(), Some(&Color::Yellow));
assert!(style.bold());
assert!(!style.italic());
assert!(!style.underline());
assert!(!style.intense());

See crate-level docs for more information.