mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-28 13:31:14 +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
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…
x
Reference in New Issue
Block a user