feat(style): add a method to create a style that reset all properties until that point

This commit is contained in:
Florian Dehau 2020-11-14 21:16:18 +01:00
parent 8a27036a54
commit a15ac8870b

View file

@ -84,6 +84,16 @@ impl Default for Style {
}
impl Style {
/// Returns a `Style` resetting all properties.
pub fn reset() -> Style {
Style {
fg: Some(Color::Reset),
bg: Some(Color::Reset),
add_modifier: Modifier::empty(),
sub_modifier: Modifier::all(),
}
}
/// Changes the foreground color.
///
/// ## Examples