diff options
author | Filippo Rossi <Qu4k@users.noreply.github.com> | 2020-05-23 15:22:08 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2020-06-06 09:07:59 -0400 |
commit | 78333f0ab3614e8dbd3dfdc95e9dbb53f80ffe5d (patch) | |
tree | 5f943c8b6353d354aa0180eefc185daa984803f1 /cli/colors.rs | |
parent | 8a4533eb75ff505f8aa16c206af1ca13f0e6c166 (diff) |
Add diff for "deno fmt --check" (#5599)
Diffstat (limited to 'cli/colors.rs')
-rw-r--r-- | cli/colors.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/colors.rs b/cli/colors.rs index 764704a5b..b9a5a7353 100644 --- a/cli/colors.rs +++ b/cli/colors.rs @@ -52,6 +52,12 @@ pub fn red_bold(s: String) -> impl fmt::Display { style(&s, style_spec) } +pub fn green_bold(s: String) -> impl fmt::Display { + let mut style_spec = ColorSpec::new(); + style_spec.set_fg(Some(Ansi256(10))).set_bold(true); + style(&s, style_spec) +} + pub fn italic_bold(s: String) -> impl fmt::Display { let mut style_spec = ColorSpec::new(); style_spec.set_bold(true).set_italic(true); @@ -64,6 +70,18 @@ pub fn black_on_white(s: String) -> impl fmt::Display { style(&s, style_spec) } +pub fn white_on_red(s: String) -> impl fmt::Display { + let mut style_spec = ColorSpec::new(); + style_spec.set_bg(Some(Red)).set_fg(Some(White)); + style(&s, style_spec) +} + +pub fn white_on_green(s: String) -> impl fmt::Display { + let mut style_spec = ColorSpec::new(); + style_spec.set_bg(Some(Ansi256(10))).set_fg(Some(White)); + style(&s, style_spec) +} + pub fn yellow(s: String) -> impl fmt::Display { let mut style_spec = ColorSpec::new(); style_spec.set_fg(Some(Ansi256(11))); |