You can use ANSI escape sequence codes
That's the way I do it, and it's programming-language independent.
If the "escape" characters make it -- the FIRST line should be
^[ (as one character) followed by [2J and so on -- you can TYPE
the following stuff (between the "cut here" lines) to see what
ANSI can do for you. (And if the escape characters do NOT make
it, let me know and I'll substitute some character that WILL
make it through and you can re-substitute back to the escapes.)
---------- cut here ---------- cut here ---------- cut here ----------
[2J[0m
[01;01f[0;31mNormal Red on black [0;32mNormal Green on black
[02;01f[1;31mHigh Red on black [1;32mHigh Green on black
[03;01f[0;37m Grey on black [0;34mNormal Blue on black is not very readable
[04;01f[1;37m White on black [1;34mHigh Blue on black
[05;01f[0;33m Orange on black [0;35mNormal Magenta on black
[06;01f[1;33m Yellow on black [1;35mHigh Magenta on black
[07;01f[0;36mNormal Cyan on black [1;36mHigh Cyan on black [5;36mHigh Cyan on grey
[0m
+-0 = White on black ("Normal") [same as Low]
| 1 = High-intensity text
ESC[xm Screen INTENSITY: x=+ 2 = Low -intensity text [same as "Normal"
+-0 = Black | 5 = Blink or high-intensity background [bright!]
| 1 = Red | 7 = Inverse (black on white) [nope]
| 2 = Green +-8 = Invisible text (fore- & back-ground same)
ESC[3x;4ym COLOR:+ 3 = Orange [nope]
| 4 = Blue These can be combined:
x=foreground | 5 = Magenta ESC[1;5m = hi-intensity blinking foreground
y=background | 6 = Cyan ESC[1;2;31;42m etc.
+-7 = White
---------- cut here ---------- cut here ---------- cut here ----------
--Myron.
--
--Myron A. Calhoun.
Five boxes preserve our freedoms: soap, ballot, witness, jury, and cartridge
NRA Life Member and Rifle, Pistol, & Home Firearm Safety Certified Instructor
Certified Instructor for the Kansas Concealed-Carry Handgun license