summaryrefslogtreecommitdiff
path: root/cli/colors.rs
diff options
context:
space:
mode:
authorPig Fang <g-plane@hotmail.com>2020-09-18 09:48:08 +0800
committerGitHub <noreply@github.com>2020-09-17 21:48:08 -0400
commite4188f7dfb95ad16750874dd2cdd4a80b48b1ecc (patch)
treecf53dddea6037814b257f1590a8d89759228fe66 /cli/colors.rs
parentd245ececb6c3eed9d6a01b877cfbbf7642454fc3 (diff)
fix(cli/fmt): make fmt output more readable (#7534)
Diffstat (limited to 'cli/colors.rs')
-rw-r--r--cli/colors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/colors.rs b/cli/colors.rs
index a324d928d..3a1616d97 100644
--- a/cli/colors.rs
+++ b/cli/colors.rs
@@ -85,6 +85,12 @@ pub fn white_on_green(s: &str) -> impl fmt::Display {
style(&s, style_spec)
}
+pub fn black_on_green(s: &str) -> impl fmt::Display {
+ let mut style_spec = ColorSpec::new();
+ style_spec.set_bg(Some(Green)).set_fg(Some(Black));
+ style(&s, style_spec)
+}
+
pub fn yellow(s: &str) -> impl fmt::Display {
let mut style_spec = ColorSpec::new();
style_spec.set_fg(Some(Yellow));