Function style
pub fn style<D>(val: D) -> StyledContent<D>where
D: Display,
Available on crate features
dep_crossterm
and std
only.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);