java terminal colors

Solutions on MaxInterview for java terminal colors by the best coders in the world

showing results for - "java terminal colors"
Hannah
19 Apr 2017
1public class ConsoleColors {
2    // Reset
3    public static final String RESET = "\033[0m";  // Text Reset
4
5    // Regular Colors
6    public static final String BLACK = "\033[0;30m";   // BLACK
7    public static final String RED = "\033[0;31m";     // RED
8    public static final String GREEN = "\033[0;32m";   // GREEN
9    public static final String YELLOW = "\033[0;33m";  // YELLOW
10    public static final String BLUE = "\033[0;34m";    // BLUE
11    public static final String PURPLE = "\033[0;35m";  // PURPLE
12    public static final String CYAN = "\033[0;36m";    // CYAN
13    public static final String WHITE = "\033[0;37m";   // WHITE
14
15    // Bold
16    public static final String BLACK_BOLD = "\033[1;30m";  // BLACK
17    public static final String RED_BOLD = "\033[1;31m";    // RED
18    public static final String GREEN_BOLD = "\033[1;32m";  // GREEN
19    public static final String YELLOW_BOLD = "\033[1;33m"; // YELLOW
20    public static final String BLUE_BOLD = "\033[1;34m";   // BLUE
21    public static final String PURPLE_BOLD = "\033[1;35m"; // PURPLE
22    public static final String CYAN_BOLD = "\033[1;36m";   // CYAN
23    public static final String WHITE_BOLD = "\033[1;37m";  // WHITE
24
25    // Underline
26    public static final String BLACK_UNDERLINED = "\033[4;30m";  // BLACK
27    public static final String RED_UNDERLINED = "\033[4;31m";    // RED
28    public static final String GREEN_UNDERLINED = "\033[4;32m";  // GREEN
29    public static final String YELLOW_UNDERLINED = "\033[4;33m"; // YELLOW
30    public static final String BLUE_UNDERLINED = "\033[4;34m";   // BLUE
31    public static final String PURPLE_UNDERLINED = "\033[4;35m"; // PURPLE
32    public static final String CYAN_UNDERLINED = "\033[4;36m";   // CYAN
33    public static final String WHITE_UNDERLINED = "\033[4;37m";  // WHITE
34
35    // Background
36    public static final String BLACK_BACKGROUND = "\033[40m";  // BLACK
37    public static final String RED_BACKGROUND = "\033[41m";    // RED
38    public static final String GREEN_BACKGROUND = "\033[42m";  // GREEN
39    public static final String YELLOW_BACKGROUND = "\033[43m"; // YELLOW
40    public static final String BLUE_BACKGROUND = "\033[44m";   // BLUE
41    public static final String PURPLE_BACKGROUND = "\033[45m"; // PURPLE
42    public static final String CYAN_BACKGROUND = "\033[46m";   // CYAN
43    public static final String WHITE_BACKGROUND = "\033[47m";  // WHITE
44
45    // High Intensity
46    public static final String BLACK_BRIGHT = "\033[0;90m";  // BLACK
47    public static final String RED_BRIGHT = "\033[0;91m";    // RED
48    public static final String GREEN_BRIGHT = "\033[0;92m";  // GREEN
49    public static final String YELLOW_BRIGHT = "\033[0;93m"; // YELLOW
50    public static final String BLUE_BRIGHT = "\033[0;94m";   // BLUE
51    public static final String PURPLE_BRIGHT = "\033[0;95m"; // PURPLE
52    public static final String CYAN_BRIGHT = "\033[0;96m";   // CYAN
53    public static final String WHITE_BRIGHT = "\033[0;97m";  // WHITE
54
55    // Bold High Intensity
56    public static final String BLACK_BOLD_BRIGHT = "\033[1;90m"; // BLACK
57    public static final String RED_BOLD_BRIGHT = "\033[1;91m";   // RED
58    public static final String GREEN_BOLD_BRIGHT = "\033[1;92m"; // GREEN
59    public static final String YELLOW_BOLD_BRIGHT = "\033[1;93m";// YELLOW
60    public static final String BLUE_BOLD_BRIGHT = "\033[1;94m";  // BLUE
61    public static final String PURPLE_BOLD_BRIGHT = "\033[1;95m";// PURPLE
62    public static final String CYAN_BOLD_BRIGHT = "\033[1;96m";  // CYAN
63    public static final String WHITE_BOLD_BRIGHT = "\033[1;97m"; // WHITE
64
65    // High Intensity backgrounds
66    public static final String BLACK_BACKGROUND_BRIGHT = "\033[0;100m";// BLACK
67    public static final String RED_BACKGROUND_BRIGHT = "\033[0;101m";// RED
68    public static final String GREEN_BACKGROUND_BRIGHT = "\033[0;102m";// GREEN
69    public static final String YELLOW_BACKGROUND_BRIGHT = "\033[0;103m";// YELLOW
70    public static final String BLUE_BACKGROUND_BRIGHT = "\033[0;104m";// BLUE
71    public static final String PURPLE_BACKGROUND_BRIGHT = "\033[0;105m"; // PURPLE
72    public static final String CYAN_BACKGROUND_BRIGHT = "\033[0;106m";  // CYAN
73    public static final String WHITE_BACKGROUND_BRIGHT = "\033[0;107m";   // WHITE
74}
Juan Pablo
19 Jan 2019
1// Define color constants
2public static final String TEXT_RESET = "\u001B[0m";
3public static final String TEXT_BLACK = "\u001B[30m";
4public static final String TEXT_RED = "\u001B[31m";
5public static final String TEXT_GREEN = "\u001B[32m";
6public static final String TEXT_YELLOW = "\u001B[33m";
7public static final String TEXT_BLUE = "\u001B[34m";
8public static final String TEXT_PURPLE = "\u001B[35m";
9public static final String TEXT_CYAN = "\u001B[36m";
10public static final String TEXT_WHITE = "\u001B[37m";
11
12// Implementation
13System.out.println(TEXT_RED + "This text is red!" + TEXT_RESET);
Maximiliano
21 Apr 2017
1public static final String ANSI_BLACK_BACKGROUND = "\u001B[40m";
2public static final String ANSI_RED_BACKGROUND = "\u001B[41m";
3public static final String ANSI_GREEN_BACKGROUND = "\u001B[42m";
4public static final String ANSI_YELLOW_BACKGROUND = "\u001B[43m";
5public static final String ANSI_BLUE_BACKGROUND = "\u001B[44m";
6public static final String ANSI_PURPLE_BACKGROUND = "\u001B[45m";
7public static final String ANSI_CYAN_BACKGROUND = "\u001B[46m";
8public static final String ANSI_WHITE_BACKGROUND = "\u001B[47m";
queries leading to this page
java console color textlist of ansi color codesstatic final string linuxjava u001b 31mjava console log colorprint in red javajava output enable ansi colorshow to use colour in terminal javajava console colours textcolored text in javahow to get color coded error message in terminal javahow to add color in the terminal in javajava windows command prompt color lybraryconsole text color javacolours in java terminalansii colors jaavjava console text coloursprint in colors jabahow to change the color in java consolechange text color java consolehow to print colours javsout java redjava change console text coloransi color light green codeprint text in color javacolor text in javasystem err not display in clolor java ascii color orangejava how to change console text colorjava cli colorscolors in terminal javajava change color of text in consolejava terminal color codesansi escape code colorsjava print background coloransi colors javaprint entir konsole in colorjava change font color in consolecolors in ansijava console change text colorjava console text colourhow to print colors in javajava console red textjava console font colorjava console use coloransi color codesjava console print in colorsjava colour textjava console text colorhow to color system out javajava color logging bashansi color codeansi color codes cjava eclipse console color textlight green on console javacolor in java consolejava color console outputjava color consoleprint with colors javahow to change the color of letters in console javajava console how to set colorjava alter ansi colorhow to change the color to the output in javajava print string with colourjava print colored textansi color codes no colourhow to print in color javachange color system out javaansi blue coloruse colors windows console javajava system out println text colorcolored terminal output javajava print with colourprint ansi in javachanging console color for javajava text colorcmd java output colorscolors in javajava color codes console outputhow to change the text color in java for consolejava color terminal outputjava ansi yellowhow to print in color kotlinterminal colors javajava colored console outputansi colorjava colours in consolejava print colors to consoleansi color encodingcolors ansi codehow to change the color of the console in javachange color of console output javahow to color text in javajava write in colorcolor console output javajava print colored text to consolejava print windows console colorjava display console colorsystem out underlines yellow in javajava system out println font coloradd color to java console outputjava print out redtermina colors javaprint console java text coloringjava ascii color codessystem out underlined yellow in javachange color of print statemeent javajava how to print colour to consoleall color codes ansisystem err not display in color in javajava set output colorhow to change system out color javajava console colorsjava print string red colorjava change console text colour 1b 5b31m javajava console coloursconsole colors java 5dcan you change the black font terminal javaprint color in javause colors windo9ws console javajava console color codejava print string different colorcolored text javajava change color of text printedansi colorsjava console application with colored textcolored java console outputcprint using colors in java consoleoutput different colours to the terminal in javajava change terminal text color linux 5c033 5b javaansi code colorjava color schemehow to color system out in javajava terminal colorsjava how to print colourhow to print colours javahow to print red color in javacolors in console javahow to print colour javaansi color javajava how to change console colorprint colour to consolejava change console color in codejava print custom coloured text to consolesystem out println in green coloransi grey javagive console output color javajava how to change the colour of a letter in the consolejava color text system out printlndifferent color text java terminalmake color console javaprintln color in javahow to change the color of the strings pritned to the console in javajava consolecolorjava console color codesprintln java colorcolored jtext javasystem out println color javajava println colorhow to change color of console in javajava console color nit worlcolours in console javacolored console text javahow to change color of console log in javaterminal color javachange console text color javajava system out color textjava change output color how to get color output in commndline javafont color javaansi terminal colorscolor java console stringlog color system out printlnjava terminal background color set tekst color in java consolehow to change text color in console javajava output colorjava color terminalhow to change the color of print out put in javacouleur system out printlnhow to print something unto console with colors using javajava print green textcolors in java consolejava color text in consolered output in javajava change color console outputset console text color javacolored console in javahow to change console color in javajava swing text colorjava colored console textjava console color windowshow to print colored text in javahow to change color of console text in javachange sout color javajava change terminal colorjava print redjava system out println color java set print colourprintf java couleurjava format println with colorcolor system outjava print colorprint colored text console javajava print colorsprintf color javajava how to put color in a console appjava colores terminalcolor text in console javahow to increase highlight string in console javaconsole prints out blue linesjava colored textcoloring text in javaprint color javajava console color outputhow to have colors in the terminal in javajava how to use ansi colorsjava color text outputhow to colorize text in javaansi codes colorjava output text in different colorscolor text javacolor java terminalchanging full console color for javajava console output colorjava print line colorstyling words on terminal in javahow to print text in red color in javajava color in consoleconsole color javajava termina text colorsjava print red color consolejava colored console 5c033 5b31m javahow to green color in console using system out printlnjava change console colorjava terminal background colorsuse colors in console message javajava console colored stringjava ansi colorhow to print a text with diffrent colour in javajava color textjava output to terminal with colorsoprint diffrent color background in javacolor ascii javaansi text color codesjava sout colorjava print color consolecolored text in console javajava console text in colorhow to print color text in java consolehow to print blue coloured text in javasystem out color javaprint string red colorjava system out with colourjava print string redprint colour javaconsole colors java invalidjava colors in consolejava ascii colorcolors on java consolechange color on text java consolehow to change color of system out printlnhow to print red color line in javava console write with color javaconsole colors javaansi escape codes colorsjava text color code print in color javajava text colour consolejava colorize print statementjava colored outputshow to print multi color in java consolecommand promp colored text javachange font color in console javajava colored console message 2f033 javahow to give color output java commandlinejava console print colorjava console coloransi color codes chartjava print color in consolehow to print in a different color javajava change text color in consolecolor in console javaset print color javahow to change a strings color in the console javajava make sout greenhow to colour text in javajava colors ascijava system out println colorset color for java console outputjava println terminal orange colorjava set console colorjava terminal colors