Color in a terminal are managed through a sequence of characters called an escape sequence that is added to your text as suffix (before) and interpreted by the terminal as command.
Characters that needs to be rendered as black character on a white background should start with the following sequence (3/4 bit color sequence)
ESC[30;47m
where:
The encoding of color representation on 3/4 bits.
ESC[{attr1};...;{attrn}m
where:
Head Attributes | |
---|---|
0 | Reset all attributes |
1 | Bright |
2 | Dim |
4 | Underscore |
5 | Blink |
7 | Reverse |
8 | Hidden |
Foreground Colours Attributes | |
---|---|
30 | Black |
31 | Red |
32 | Green |
33 | Yellow |
34 | Blue |
35 | Magenta |
36 | Cyan |
37 | White |
Background Colours Attributes | |
---|---|
40 | Black |
41 | Red |
42 | Green |
43 | Yellow |
44 | Blue |
45 | Magenta |
46 | Cyan |
47 | White |