mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 20:53:19 +00:00
feat(style): add a method to create a style that reset all properties until that point
This commit is contained in:
parent
8a27036a54
commit
a15ac8870b
1 changed files with 10 additions and 0 deletions
10
src/style.rs
10
src/style.rs
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue