server-beta icon indicating copy to clipboard operation
server-beta copied to clipboard

Colors in console text

Open adib-yg opened this issue 2 years ago • 1 comments

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: image

adib-yg avatar Dec 26 '23 02:12 adib-yg

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

BigETI avatar Dec 26 '23 06:12 BigETI