Package nl.colorize.util.cli
Class AnsiColor
java.lang.Object
nl.colorize.util.cli.AnsiColor
ANSI escape codes
to format command line output in a more human-readable way. This class
intentionally does not support white or black, since both black-on-white
and white-on-black terminals are widely used, so this avoids formatting
that would make the text unreadable.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
static final AnsiColor
-
Method Summary
Modifier and TypeMethodDescriptionFormats the specified text using this color and styling.void
Formats the specified text using this color and styling, then prints the result tostdout
.void
Formats the specified text using this color and styling, then prints the result tostdout
.
-
Field Details
-
RED
-
GREEN
-
YELLOW
-
BLUE
-
MAGENTA
-
CYAN
-
RED_BOLD
-
GREEN_BOLD
-
YELLOW_BOLD
-
BLUE_BOLD
-
MAGENTA_BOLD
-
CYAN_BOLD
-
-
Method Details
-
format
Formats the specified text using this color and styling. Returns the formatting string including ANSI escape codes. -
print
Formats the specified text using this color and styling, then prints the result tostdout
. Using this method is a shorthand/convenience version ofSystem.out.print(format(text))
. -
println
Formats the specified text using this color and styling, then prints the result tostdout
. Using this method is a shorthand/convenience version ofSystem.out.println(format(text))
.
-