Colors
Computers represent colors with the RGB model: Red Green Blue is the order. You need a set of 3 numbers for make color to work: rgb(255, 0, 0)
Minimum number for each is 0, and maximum number is 255. The color above is red, because the red value is at max and blue and green are both at 0. Below is the hexadecimal formatting of red. With hexadecimal formatting, each primary color is given 2 digits, so the FF is for Red, 00 in the middle is for Green, and 00 on the right is for Blue: #ff0000
CHS Colors
Teal
#008b99
rgb(0, 139, 153)
Gold
#8d8454
rgb(141, 132, 84)
Light Teal
#eeffff
rgb(238, 255, 255)
Light Gold
#fffadd
rgb(255, 250, 221)
Black
#000000
rgb(0, 0, 0)
White
#ffffff
rgb(255, 255, 255)
Console Text Color
To make your text colorful when text-based coding you can prepend this, and use numbers for RGB
\033[38;2;255;128;255m
(light purple)
To highlight your text colorfully when text-based coding you can prepend this and use numbers for RGB.
\033[48;2;128;255;255m
(cyan)
When doing this you must end the print statement with the reset code:
\033[0m
Clear the Console
//clear the console
System.out.print("\033c");
System.out.println("\033[38;2;255;128;255mYour text here\033[0m");
or
System.out.print("\033[38;2;255;128;255m");
System.out.print("\033[48;2;128;255;255m");
System.out.println("Your text here\033[0m");
You may also want to prepend different text features:
bold = "\033[01m"
underline = "\033[04m"
reverse = "\033[07m"
invisible = "\033[08m"