forked from mars/breed
1
0
Fork 0

Add Style::apply()

This commit is contained in:
mars 2023-04-12 12:40:16 -04:00
parent ce13258ca7
commit 86bbfcda60
1 changed files with 11 additions and 0 deletions

View File

@ -142,6 +142,17 @@ impl Style {
Ok(())
}
/// Applies another [Style] on top of this one.
pub fn apply(&mut self, other: &Style) {
if other.fg.is_some() {
self.fg = other.fg;
}
if other.bg.is_some() {
self.bg = other.bg;
}
}
}
#[derive(Clone, Debug, Default)]