summaryrefslogtreecommitdiffstats
path: root/src/style.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/style.rs')
-rw-r--r--src/style.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/style.rs b/src/style.rs
index dbac0863..734d3b9f 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -39,6 +39,20 @@ impl Style {
}
}
+ pub fn from_colors(
+ foreground: Option<ansi_term::Color>,
+ background: Option<ansi_term::Color>,
+ ) -> Self {
+ Self {
+ ansi_term_style: ansi_term::Style {
+ foreground,
+ background,
+ ..ansi_term::Style::new()
+ },
+ ..Self::new()
+ }
+ }
+
pub fn paint<'a, I, S: 'a + ToOwned + ?Sized>(
self,
input: I,