Colours are added to text using special codes, and then calling either WriteC or PrintC. Text styles should be reset by adding the reset code (%n) once finished.
For example, to display "This text is RED, this text is BLUE.", the following string should be used: "This text is %rRED%n, this text is %bBLUE%n.".
Note
Some colours and styles only work on ANSI terminals.
Table 1. Colour codes
Colour | Normal style | Bold style | Background |
---|---|---|---|
Black | %k | %K | %0 |
Red | %r | %R | %1 |
Green | %g | %G | %2 |
Yellow | %y | %Y | %3 |
Blue | %b | %B | %4 |
Magenta | %m | %M | %5 |
Purple | %p | %P | |
Cyan | %c | %C | %6 |
White | %w | %W | %7 |
Table 2. Style codes
Style | Code |
---|---|
Blinking, flashing | %F |
Underline | %U |
Invert, reverse | %8 |
Bold | %_, %9 |
Reset color | %n |
Single% | %% |