Subject: | BUG/Request: add support for high intensity foreground / background codes |
I'd like to request support for bright (or high-intensity) foreground and background codes (\e[90m .. \e[97m and \e[100m .. \e[107m, respectively). The escape codes can be emulated via "bold" and "underline", but direct support would be prefered.
The codes are already supported and output by Term::ANSIColor.
I'm attaching a combined patch from my repo (https://github.com/rivy/perl.Win32-Console-ANSI) which adds [support](https://github.com/rivy/perl.Win32-Console-ANSI/commit/79b7dccf9f3c24e00deebf18639cf6df8fd92c1c) and [documentation](https://github.com/rivy/perl.Win32-Console-ANSI/commit/1f2a11385afa3f1bd095fcab69d13118ebc05151).
I've been using the updated version without issue for a few months now.
Subject: | high-intensity.patch |
From 79b7dccf9f3c24e00deebf18639cf6df8fd92c1c Mon Sep 17 00:00:00 2001
From: Roy Ivy III <rivy.dev@gmail.com>
Date: Mon, 4 Sep 2017 21:41:40 -0500
Subject: [PATCH 1/2] add: high intensity ANSI sequences ("bright foreground"
and "bright background")
* added high-intensity/bright sequences for ...
foreground == \e[90m .. \e[m97
background == \e[100m .. \e[m107
* note: high-intensity foreground uses "bold", background uses "underline"
---
ANSI.xs | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ANSI.xs b/ANSI.xs
index cfbabf2..fc86ae6 100644
--- a/ANSI.xs
+++ b/ANSI.xs
@@ -530,6 +530,16 @@ void InterpretEscSeq( )
DEBUGSTR("setting background to = 0x%.8x", background);
background = es_argv[i]-40;
}
+ if ( (90 <= es_argv[i]) && (es_argv[i] <= 97) ) {
+ bold = 1;
+ foreground = es_argv[i]-90;
+ DEBUGSTR("setting foreground to = 0x%.8x", foreground);
+ }
+ if ( (100 <= es_argv[i]) && (es_argv[i] <= 107) ) {
+ DEBUGSTR("setting background to = 0x%.8x", background);
+ underline = 1;
+ background = es_argv[i]-100;
+ }
}
if (rvideo) attribut = foregroundcolor[background] | backgroundcolor[foreground];
else attribut = foregroundcolor[foreground] | backgroundcolor[background];
--
2.14.1.windows.1
From 1f2a11385afa3f1bd095fcab69d13118ebc05151 Mon Sep 17 00:00:00 2001
From: Roy Ivy III <rivy.dev@gmail.com>
Date: Sun, 22 Oct 2017 15:18:28 -0500
Subject: [PATCH 2/2] add: documentation for high intensity ANSI sequences
---
lib/Win32/Console/ANSI.pm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/lib/Win32/Console/ANSI.pm b/lib/Win32/Console/ANSI.pm
index 08b9028..7a21dd3 100644
--- a/lib/Win32/Console/ANSI.pm
+++ b/lib/Win32/Console/ANSI.pm
@@ -324,6 +324,28 @@ screen.
49 Default background color
+=item * Bright / high-intensity foreground colors
+
+ 90 Bright Black (aka Dark Gray)
+ 91 Bright Red
+ 92 Bright Green
+ 93 Bright Yellow
+ 94 Bright Blue
+ 95 Bright Magenta
+ 96 Bright Cyan
+ 97 Bright White
+
+=item * Bright / high-intensity background colors
+
+ 100 Bright Black (aka Dark Gray)
+ 101 Bright Red
+ 102 Bright Green
+ 103 Bright Yellow
+ 104 Bright Blue
+ 105 Bright Magenta
+ 106 Bright Cyan
+ 107 Bright White
+
=back
\e[m is equivalent to \e[0m.
--
2.14.1.windows.1