diff --git a/src/theme.rs b/src/theme.rs index 5ff0210..ae65b4c 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -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)]