pub fn style<D: Display>(val: D) -> StyledContent<D>
Expand description
Creates a StyledContent
.
This could be used to style any type that implements Display
with colors and text attributes.
See StyledContent
for more info.
§Examples
use crossterm::style::{style, Stylize, Color};
let styled_content = style("Blue colored text on yellow background")
.with(Color::Blue)
.on(Color::Yellow);
println!("{}", styled_content);