[][src]Function crossterm::style::style

pub fn style<'a, D: 'a>(val: D) -> StyledContent<D> where
    D: Display + Clone

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, Color};

let styled_content = style("Blue colored text on yellow background")
    .with(Color::Blue)
    .on(Color::Yellow);

println!("{}", styled_content);