Struct termimad::StyledChar
source · pub struct StyledChar { /* private fields */ }
Expand description
A modifiable character which can be easily written or repeated. Can be used for bullets, horizontal rules or quote marks.
Implementations§
source§impl StyledChar
impl StyledChar
pub fn new(compound_style: CompoundStyle, nude_char: char) -> StyledChar
pub fn nude(nude_char: char) -> StyledChar
pub fn from_fg_char(fg: Color, nude_char: char) -> StyledChar
pub const fn get_char(&self) -> char
sourcepub fn set_fg(&mut self, color: Color)
pub fn set_fg(&mut self, color: Color)
Change the fg color, keeping the char, bg color and attributes
pub const fn get_fg(&self) -> Option<Color>
sourcepub fn set_bg(&mut self, color: Color)
pub fn set_bg(&mut self, color: Color)
Change the bg color, keeping the char, fg color and attributes
pub const fn get_bg(&self) -> Option<Color>
sourcepub fn set_compound_style(&mut self, compound_style: CompoundStyle)
pub fn set_compound_style(&mut self, compound_style: CompoundStyle)
Change the style (colors, attributes) of the styled char
sourcepub fn repeated(&self, count: usize) -> StyledContent<String>
pub fn repeated(&self, count: usize) -> StyledContent<String>
Return a struct implementing Display
, made of a (optimized) repetition
of the character with its style.
pub fn queue_repeat<W: Write>(&self, w: &mut W, count: usize) -> Result<(), Error>
pub fn queue<W: Write>(&self, w: &mut W) -> Result<(), Error>
pub fn blend_with<C: Into<Color>>(&mut self, color: C, weight: f32)
Trait Implementations§
source§impl Clone for StyledChar
impl Clone for StyledChar
source§fn clone(&self) -> StyledChar
fn clone(&self) -> StyledChar
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more