diff --git a/cursive-core/src/theme/color_style.rs b/cursive-core/src/theme/color_style.rs index f9715ef..a5e96de 100644 --- a/cursive-core/src/theme/color_style.rs +++ b/cursive-core/src/theme/color_style.rs @@ -26,6 +26,22 @@ impl ColorStyle { Self { front, back } } + /// Uses the given color as front, inherits the parent background color. + pub fn front(front: F) -> Self + where + F: Into, + { + Self::new(front, ColorType::InheritParent) + } + + /// Uses the given color as background, inherits the parent front color. + pub fn back(back: B) -> Self + where + B: Into, + { + Self::new(ColorType::InheritParent, back) + } + /// Style set by terminal before entering a Cursive program. pub fn terminal_default() -> Self { Self::new(Color::TerminalDefault, Color::TerminalDefault)