Last active
December 23, 2022 21:10
-
-
Save bw2012/85f345a2b18d84a3dbe56756dde9c852 to your computer and use it in GitHub Desktop.
Sample color console for C/C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/4053837/colorizing-text-in-the-console-with-c | |
#include <iostream> | |
#include <string> | |
int main(int argc, char ** argv){ | |
printf("\n"); | |
printf("\x1B[31mTexting\033[0m\t\t"); | |
printf("\x1B[32mTexting\033[0m\t\t"); | |
printf("\x1B[33mTexting\033[0m\t\t"); | |
printf("\x1B[34mTexting\033[0m\t\t"); | |
printf("\x1B[35mTexting\033[0m\n"); | |
printf("\x1B[36mTexting\033[0m\t\t"); | |
printf("\x1B[36mTexting\033[0m\t\t"); | |
printf("\x1B[36mTexting\033[0m\t\t"); | |
printf("\x1B[37mTexting\033[0m\t\t"); | |
printf("\x1B[93mTexting\033[0m\n"); | |
printf("\033[3;42;30mTexting\033[0m\t\t"); | |
printf("\033[3;43;30mTexting\033[0m\t\t"); | |
printf("\033[3;44;30mTexting\033[0m\t\t"); | |
printf("\033[3;104;30mTexting\033[0m\t\t"); | |
printf("\033[3;100;30mTexting\033[0m\n"); | |
printf("\033[3;47;35mTexting\033[0m\t\t"); | |
printf("\033[2;47;35mTexting\033[0m\t\t"); | |
printf("\033[1;47;35mTexting\033[0m\t\t"); | |
printf("\t\t"); | |
printf("\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment