How can I print a text on console with highlighted colour.
I found this link but this talks about printing text in colur and not highlighting it with another color.
Example:
How can I print a text on console with highlighted colour.
I found this link but this talks about printing text in colur and not highlighting it with another color.
Example:
To switch on a yellow background (say), you need the escape sequence
java.lang.String("\033[43m");
Combine this with a black foreground to get what you want.
I'm getting the escape sequences from this Scala doc. Although it's Scala doc it's relevant and applicable in Java. The Jansi library should handle this. See the 'background' references in the Ansi
class.