StyleExt

Trait StyleExt 

Source
pub trait StyleExt {
    // Required methods
    fn styled(&self) -> StyledText<'_>;
    fn color(&self, r: u8, g: u8, b: u8) -> StyledText<'_>;
    fn hex_color(&self, hex: &str) -> Result<StyledText<'_>, String>;
    fn bold(&self) -> StyledText<'_>;
    fn italic(&self) -> StyledText<'_>;
    fn underline(&self, style: UnderlineStyle) -> StyledText<'_>;
}
Expand description

Extension trait for easy styling

Required Methods§

Source

fn styled(&self) -> StyledText<'_>

Convert to StyledText for further styling

Source

fn color(&self, r: u8, g: u8, b: u8) -> StyledText<'_>

Quick color application

Source

fn hex_color(&self, hex: &str) -> Result<StyledText<'_>, String>

Quick hex color application

Source

fn bold(&self) -> StyledText<'_>

Quick bold styling

Source

fn italic(&self) -> StyledText<'_>

Quick italic styling

Source

fn underline(&self, style: UnderlineStyle) -> StyledText<'_>

Quick underline styling

Implementations on Foreign Types§

Source§

impl StyleExt for str

Source§

fn styled(&self) -> StyledText<'_>

Source§

fn color(&self, r: u8, g: u8, b: u8) -> StyledText<'_>

Source§

fn hex_color(&self, hex: &str) -> Result<StyledText<'_>, String>

Source§

fn bold(&self) -> StyledText<'_>

Source§

fn italic(&self) -> StyledText<'_>

Source§

fn underline(&self, style: UnderlineStyle) -> StyledText<'_>

Implementors§