java using color with System.out??
Hi.
Does anyone know a way of using System.out.println("whatever") so that i can define the color of the string output to the screen? cheers. Ben. |
Assuming your terminal emulator is accepting ansi color sequences, which is nowadays almost always the case, you can send escape sequences that change the foreground and background colors.
e.g.: System.out.println("\033[31m\033[44mHello world\033[0m\n"); |
All times are GMT -5. The time now is 01:27 PM. |