server-beta
server-beta copied to clipboard
Colors in console text
I just got this idea, I don't know if it is possible or not. but it's kinda cool.
Foreground
#define RESET "\033[0m"
#define FORE_GREEN "\033[32m"
printf(""FORE_GREEN"This is green"RESET"");
Background
#define RESET "\033[0m"
#define BACK_GREEN "\033[42m"
printf(""BACK_GREEN"Green background"RESET"");
Example output in omp-server console:
To begin with I would recommend prefixing them with the CONSOLE_ or CONSOLE_COLOUR_ keywords.
There are multiple types of console color escape sequences and there is no guarantee that a console supports all types of color escape sequences.
This thread explains them well: https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences