c 2b 2b colored output

Solutions on MaxInterview for c 2b 2b colored output by the best coders in the world

showing results for - "c 2b 2b colored output"
Ilaria
22 Jan 2016
1#include <stdio.h>
2
3
4
5// [0;31m	Red
6// [1;31m	Bold Red
7// [0;32m	Green
8// [1;32m	Bold Green
9// [0;33m	Yellow
10// [01;33m	Bold Yellow
11// [0;34m	Blue
12// [1;34m	Bold Blue
13// [0;35m	Magenta
14// [1;35m	Bold Magenta
15// [0;36m	Cyan
16// [1;36m	Bold Cyan
17// [0m	Reset
18
19
20
21
22int main () {
23  printf("\033[1;31m");
24  printf("Hello world\n");
25  printf("\033[0m;")
26  return 0;
27}
28
Ben
22 Mar 2018
1//the following are UBUNTU/LINUX, and MacOS ONLY terminal color codes.
2#define RESET   "\033[0m"
3#define BLACK   "\033[30m"      /* Black */
4#define RED     "\033[31m"      /* Red */
5#define GREEN   "\033[32m"      /* Green */
6#define YELLOW  "\033[33m"      /* Yellow */
7#define BLUE    "\033[34m"      /* Blue */
8#define MAGENTA "\033[35m"      /* Magenta */
9#define CYAN    "\033[36m"      /* Cyan */
10#define WHITE   "\033[37m"      /* White */
11#define BOLDBLACK   "\033[1m\033[30m"      /* Bold Black */
12#define BOLDRED     "\033[1m\033[31m"      /* Bold Red */
13#define BOLDGREEN   "\033[1m\033[32m"      /* Bold Green */
14#define BOLDYELLOW  "\033[1m\033[33m"      /* Bold Yellow */
15#define BOLDBLUE    "\033[1m\033[34m"      /* Bold Blue */
16#define BOLDMAGENTA "\033[1m\033[35m"      /* Bold Magenta */
17#define BOLDCYAN    "\033[1m\033[36m"      /* Bold Cyan */
18#define BOLDWHITE   "\033[1m\033[37m"      /* Bold White */
Enrico
27 Feb 2018
1#define RESET   "\033[0m"
2#define BLACK   "\033[30m"      /* Black */
3#define RED     "\033[31m"      /* Red */
4#define GREEN   "\033[32m"      /* Green */
5#define YELLOW  "\033[33m"      /* Yellow */
6#define BLUE    "\033[34m"      /* Blue */
7#define MAGENTA "\033[35m"      /* Magenta */
8#define CYAN    "\033[36m"      /* Cyan */
9#define WHITE   "\033[37m"      /* White */
10#define BOLDBLACK   "\033[1m\033[30m"      /* Bold Black */
Ignacio
30 Oct 2020
1// For windows only
2#include <Windows.h>
3
4std::string textColor(int colorID = 1, std::string textToColor = "") {
5		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), colorID);
6		return textToColor;
7}
8
9// Usage: std::cout << textColor(1, "example");
10
11// Color ID's
12/*
131: Blue
142: Green
153: Cyan
164: Red
175: Purple
186: Dark Yellow
197: White
208: Grey
219: Bright blue
2210: Brigth green
2311: Bright cyan
2412: Bright red
2513: Pink
2614: Yellow
2715: Bright white
28*\
Elías
22 Nov 2018
1    Black \033[0;30m
2
3    Red \033[0;31m
4
5    Green \033[0;32m
6
7    Yellow \033[0;33m
8
9    Blue \033[0;34m
10
11    Purple \033[0;35m
12
13    Cyan \033[0;36m
14
15    White \033[0;37m
queries leading to this page
c 2b 2b cout color 32how to output colour in c 2b 2bc 2b 2b colored console outputlibrary for print colorful c 2b 2bcout colorcpp color terminalc 2b 2b printing in colorc 2b 2b cout 3c 3c colorc 2b 2b cout color outputprint color c 2b 2bred color code c 2b 2b terminalc 2b 2b color codes linuxc 2b 2b 5c033 colored outputcout with colorcpp print colorc 2b 2b cout colorcolor codes cppprint colored text in c 2b 2bcout colourhow to color cout text in c 2b 2bprint in color c 2b 2b in linuxhow to change colour of text in c 2b 2b printf libndsclove gradientcolored output c 2b 2bto print color text in c 2b 2bcout colored textc 2b 2b colored outputhow to print different colored text in c 2b 2bbold red in cppc 2b 2b color outputprint cpp with colorstd cout colorhow to print output in different color in c 2b 2boutput different color c 2b 2bc 2b 2b output text in color in filesend text in color in c 2b 2bc 2b 2b colored asciichange cout text color c 2b 2bc 2b 2b print colorscolor cout linux terminalc 2b 2b linux cout colorc 2b 2b cout colored textprint in different colors c 2b 2boutput colorato c 2b 2bprint in color c 2b 2bc 2b 2b to colorized word documentc 2b 2b print colored texthoe to make output colorful in c 2b 2bc 2b 2b shell backgroudn colorc 2b 2b print in colorhow to print colored text in c 2b 2bprinting colored toxt in c 2b 2bhow to output colored text in c 2b 2bc 2b 2b print with colorc 2b 2b printf color textstd cout color textc 2b 2b color printcss colorhow to print colored text c 2b 2bc 2b 2b colorful outputoutputting colored text in c 2b 2bc 2b 2b string color formathow to get colors in stdout linux cppc 2b 2b 1b colored outputcolor in c 2b 2b outputprint colors c 2b 2bcolor output in c 2b 2bhow to cout colored text c 2b 2bprint in colors c 2b 2bchange color cout c 2b 2bcpp print in colorcolor on terminal c 2b 2bc 2b 2b cout with colorcout change colorprinting colored text in c 2b 2bcolored output cppprint in color cppoutput color text c 2b 2berror print red c 2b 2bc 2b 2b print text in color in fulehow to print with color on c 2b 2bcpp print with colorhow to change colour of text in c 2b 2b printfdisplay string color c 2b 2bcolor output c 2b 2bhow to print different colors in c 2b 2bprint colored text c 2b 2bterminal colors c 2b 2boutput colored text c 2b 2bcout c 2b 2b color textc 2b 2b print different colorsc 2b 2b cout colouruse colors in print cppc 2b 2b cout change text colorhow to print coloured text in c 2b 2bc 2b 2b print text in different colorcpp use color printstd 3a 3acout colorshow to change output color in c 2b 2bc 2b 2b color console linuxc 2b 2b console output colorc 2b 2b print color in terminalc 2b 2b colored outputc 2b 2b red outputcout colored string c 2b 2bhow to print colored text in cppcolored output cpp windowschange color of output in c 2b 2b coutc 2b 2b print colorchange printf color c 2b 2bcout color c 2b 2bfc 2b 2b mt print with colorcolor print c 2b 2bc 2b 2b print text in colorc 2b 2b terminal color codesprint with color c 2b 2bprint text colour c 2b 2bc 2b 2b colored output