Struct crossterm::ObjectStyle
source · pub struct ObjectStyle {
pub fg_color: Option<Color>,
pub bg_color: Option<Color>,
pub attrs: Vec<Attribute>,
}
Expand description
Struct that contains the style properties that can be applied to an displayable object.
Fields§
§fg_color: Option<Color>
§bg_color: Option<Color>
§attrs: Vec<Attribute>
Implementations§
source§impl ObjectStyle
impl ObjectStyle
sourcepub fn apply_to<D: Display>(&self, val: D) -> StyledObject<D>
pub fn apply_to<D: Display>(&self, val: D) -> StyledObject<D>
Apply an StyledObject
to the passed displayable object.
sourcepub fn new() -> ObjectStyle
pub fn new() -> ObjectStyle
Get an new instance of ObjectStyle
sourcepub fn bg(self, color: Color) -> ObjectStyle
pub fn bg(self, color: Color) -> ObjectStyle
Set the background color of ObjectStyle
to the passed color.
sourcepub fn fg(self, color: Color) -> ObjectStyle
pub fn fg(self, color: Color) -> ObjectStyle
Set the foreground color of ObjectStyle
to the passed color.
Trait Implementations§
source§impl Clone for ObjectStyle
impl Clone for ObjectStyle
source§fn clone(&self) -> ObjectStyle
fn clone(&self) -> ObjectStyle
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 moresource§impl Default for ObjectStyle
impl Default for ObjectStyle
source§fn default() -> ObjectStyle
fn default() -> ObjectStyle
Returns the “default value” for a type. Read more