pub struct Style { /* private fields */ }
Expand description
A stored style that can be applied.
Implementations§
source§impl Style
impl Style
sourcepub fn from_dotted_str(s: &str) -> Style
pub fn from_dotted_str(s: &str) -> Style
Creates a style from a dotted string.
Effectively the string is split at each dot and then the
terms in between are applied. For instance red.on_blue
will
create a string that is red on blue background. Unknown terms
are ignored.
sourcepub fn apply_to<D>(&self, val: D) -> StyledObject<D>
pub fn apply_to<D>(&self, val: D) -> StyledObject<D>
Apply the style to something that can be displayed.
sourcepub fn force_styling(self, value: bool) -> Style
pub fn force_styling(self, value: bool) -> Style
Forces styling on or off.
This overrides the detection from clicolors-control
.