forked from mars/breed
Add Style::apply()
This commit is contained in:
parent
ce13258ca7
commit
86bbfcda60
11
src/theme.rs
11
src/theme.rs
|
@ -142,6 +142,17 @@ impl Style {
|
||||||
|
|
||||||
Ok(())
|
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)]
|
#[derive(Clone, Debug, Default)]
|
||||||
|
|
Reference in New Issue