Serializable, Comparable<Byte>, org.refcodes.mixin.CodeAccessor<Byte>public enum AnsiEscapeCode extends Enum<AnsiEscapeCode> implements org.refcodes.mixin.CodeAccessor<Byte>
toEscapeSequence(AnsiEscapeCode...). Use
toEscapedSequence(String) when you wish to print the ANSI
Escape-Code sequence without the sequence modifying your terminal output
(e.g. helpful in error messages regarding ANSI Escape-Codes).org.refcodes.mixin.CodeAccessor.CodeBuilder<T extends Object,B extends org.refcodes.mixin.CodeAccessor.CodeBuilder<T,B>>, org.refcodes.mixin.CodeAccessor.CodeMutator<T extends Object>, org.refcodes.mixin.CodeAccessor.CodeProperty<T extends Object>| Enum Constant | Description |
|---|---|
BG_BLACK |
Background Black: Set background color.
|
BG_BLUE |
Background Blue: Set background color.
|
BG_BRIGHT_BLACK |
Background Bright Black: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_BLUE |
Background Bright Blue: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_CYAN |
Background Bright Cyan: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_DEFAULT |
Background Bright Default: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_GREEN |
Background Bright Green: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_MAGENTA |
Background Bright Magenta: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_RED |
Background Bright Red: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_WHITE |
Background Bright White: Set bright background color (aixterm (not in
standard)).
|
BG_BRIGHT_YELLOW |
Background Bright Yellow: Set bright background color (aixterm (not in
standard)).
|
BG_CYAN |
Background Cyan: Set background color.
|
BG_GREEN |
Background Green: Set background color.
|
BG_MAGENTA |
Background Magenta: Set background color.
|
BG_RED |
Background Red: Set background color.
|
BG_WHITE |
Background White: Set background color.
|
BG_YELLOW |
Background Yellow: Set background color.
|
BLINK_OFF |
Blink off
|
BOLD |
Bold or increased intensity:
|
CONCEAL |
Conceal: Not widely supported.
|
CROSSED_OUT |
Crossed-out: Characters legible but marked for deletion.
|
DEFAULT_BACKGROUND_COLOR |
Default background color: implementation defined (according to standard)
|
DEFAULT_FONT |
Primary(default) font
|
DEFAULT_FOREGROUND_COLOR |
Default foreground color: implementation defined (according to standard)
|
DOUBLY_UNDERLINE_OR_BOLD_OFF |
Doubly underline or Bold off: Double-underline per ECMA-48.
|
ENCIRCLED |
Encircled
|
FAINT |
Faint (decreased intensity):
|
FG_BLACK |
Foreground Black: Set foreground color.
|
FG_BLUE |
Foreground Blue: Set foreground color.
|
FG_BRIGHT_BLACK |
Foreground Bright Black: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_BLUE |
Foreground Bright Blue: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_CYAN |
Foreground Bright Cyan: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_DEFAULT |
Foreground Bright Default: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_GREEN |
Foreground Bright Green: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_MAGENTA |
Foreground Bright Magenta: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_RED |
Foreground Bright Red: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_WHITE |
Foreground Bright White: Set bright foreground color (aixterm (not in
standard)).
|
FG_BRIGHT_YELLOW |
Foreground Bright Yellow: Set bright foreground color (aixterm (not in
standard)).
|
FG_CYAN |
Foreground Cyan: Set foreground color.
|
FG_GREEN |
Foreground Green: Set foreground color.
|
FG_MAGENTA |
Foreground Magenta: Set foreground color.
|
FG_RED |
Foreground Red: Set foreground color.
|
FG_WHITE |
Foreground White: Set foreground color.
|
FG_YELLOW |
Foreground Yellow: Set foreground color.
|
FONT_1 |
Font 1: Select alternative font 1.
|
FONT_2 |
Font 2: Select alternative font 2.
|
FONT_3 |
Font 3: Select alternative font 3.
|
FONT_4 |
Font 4: Select alternative font 4.
|
FONT_5 |
Font 5: Select alternative font 5.
|
FONT_6 |
Font 6: Select alternative font 6.
|
FONT_7 |
Font 7: Select alternative font 7.
|
FONT_8 |
Font 8: Select alternative font 8.
|
FONT_9 |
Font 9: Select alternative font 9.
|
FRAKTUR |
Fraktur: Rarely supported.
|
FRAMED |
Framed
|
IDEOGRAM_ATTRIBUTES_OFF |
Ideogram attributes off: Reset the effects of all of 60–64.
|
IDEOGRAM_DOUBLE_OVERLINE_OR_DOUBLE_LINE_ON_THE_LEFT_SIDE |
Ideogram double overline or double line on the left side : Rarely
supported.
|
IDEOGRAM_DOUBLE_UNDERLINE_OR_DOUBLE_LINE_ON_THE_RIGHT_SIDE |
Ideogram double underline or double line on the right side : Rarely
supported.
|
IDEOGRAM_OVERLINE_OR_LEFT_SIDE_LINE |
Ideogram overline or left side line : Rarely supported.
|
IDEOGRAM_STRESS_MARKING |
Ideogram stress marking : Rarely supported.
|
IDEOGRAM_UNDERLINE_OR_RIGHT_SIDE_LINE |
Ideogram underline or right side line: Rarely supported.
|
INVERSE_OFF |
Inverse off
|
ITALIC |
Italic: Not widely supported.
|
NORMAL_COLOR_OR_INTENSITY |
Normal color or intensity: Neither bold nor faint.
|
NOT_CROSSED_OUT |
Not crossed out
|
NOT_FRAMED |
Not framed or encircled
|
NOT_ITALIC_NOT_FRAKTUR |
Not italic: Not Fraktur.
|
NOT_OVERLINED |
Not overlined
|
OVERLINED |
Overlined
|
RAPID_BLINK |
Rapid Blink: 150+ per minute.
|
RESET |
Reset / Normal: All attributes off (reset).
|
REVEAL |
Reveal: Conceal off.
|
REVERSE_VIDEO |
Reverse Video: Swap foreground and background colors.
|
SET_BACKGROUND_COLOR |
Set background color: Next arguments are
5;n or
2;r;g;b, see below:
ESC[48:5:(n)m; Select background color, (n) represents
an index into a predefined 256-color lookup table
ESC[48;2;(r);(g);(b)m: Select RGB background color, (r)
represents the 8 bit red portion of an RGB color, (g) represents the 8
bit green portion of an RGB color, (b) represents the 8 bit blue portion
of an RGB color
|
SET_FOREGROUND_COLOR |
Set foreground color: Next arguments are
5;n or
2;r;g;b, see below:
ESC[38:5:(n)m: Select foreground color, (n) represents
an index into a predefined 256-color lookup table
ESC[38;2;(r);(g);(b)m: Select RGB foreground color, (r)
represents the 8 bit red portion of an RGB color, (g) represents the 8
bit green portion of an RGB color, (b) represents the 8 bit blue portion
of an RGB color
|
SLOW_BLINK |
Slow Blink: Less than 150 per minute.
|
UNDERLINE |
Underline
|
UNDERLINE_OFF |
Underline off: Not singly or doubly underlined.
|
| Modifier and Type | Field | Description |
|---|---|---|
static char |
COLOR_TABLE_SELECTOR_PARAMETER |
In case of
SET_FOREGROUND_COLOR or
SET_BACKGROUND_COLOR, the
COLOR_TABLE_SELECTOR_PARAMETER specifies that the succeeding
parameter represents an index into the ANSI Color-Table. |
static char |
ESCAPE |
The ANSI Escape-Code with which each ANSI escape sequence is commenced.
|
static char |
ESCAPE_PARAMETER_DELIMITER |
The delimiter used to separate the parameters of an ANSI Escape-Sequence,
e.g. the parameters "0", "1" and ""4" of the sequence
"
<ESC>[0;1;4m". |
static char |
ESCAPE_PREFIX_DELIMITER |
The delimiter used to separate the leading Escape-Code <ESC> of an
ANSI Escape-Sequence from the succeeding portion, e.g. "[" separates
<ESC> from "[0;1;4m" of the sequence
"
<ESC>[0;1;4m". |
static char |
ESCAPE_SUFFIX |
The ANSI Escape-Code with which each ANSI escape sequence is concluded.
|
static char |
RGB_COLOR_SELECTOR_PARAMETER |
In case of
SET_FOREGROUND_COLOR or
SET_BACKGROUND_COLOR, the RGB_COLOR_SELECTOR_PARAMETER
specifies that the succeeding parameters represent RGB values. |
| Modifier and Type | Method | Description |
|---|---|---|
Byte |
getCode() |
|
String |
toEscaped() |
Returns the escaped ANSI Escape-Code to be printable without triggering
the actual ANSI escape commands.
|
static String |
toEscapedSequence(String aEscapeSequence) |
Makes the provided Escape-Sequence printable by replacing the
ESCAPE code with a printable char sequence. |
static Region[] |
toEscapedSequenceRegions(String aEscapedString) |
Retrieves a list of regions (begin index, end index ) with ANSI escape
codes.
|
static String |
toEscapeSequence(AnsiEscapeCode... aAnsiEscapeCodes) |
Basic functionality to create an ANSI Escape-Code sequence from the
provided
AnsiEscapeCode elements directly printable to
System.out. |
static int |
toUnescapedLength(String aEscapedString) |
|
static String |
toUnescapedString(String aEscapedString) |
Removes any ANSI escape codes from the provided
String. |
static AnsiEscapeCode |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static AnsiEscapeCode[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AnsiEscapeCode RESET
public static final AnsiEscapeCode BOLD
public static final AnsiEscapeCode FAINT
public static final AnsiEscapeCode ITALIC
public static final AnsiEscapeCode UNDERLINE
public static final AnsiEscapeCode SLOW_BLINK
public static final AnsiEscapeCode RAPID_BLINK
public static final AnsiEscapeCode REVERSE_VIDEO
public static final AnsiEscapeCode CONCEAL
public static final AnsiEscapeCode CROSSED_OUT
public static final AnsiEscapeCode DEFAULT_FONT
public static final AnsiEscapeCode FONT_1
public static final AnsiEscapeCode FONT_2
public static final AnsiEscapeCode FONT_3
public static final AnsiEscapeCode FONT_4
public static final AnsiEscapeCode FONT_5
public static final AnsiEscapeCode FONT_6
public static final AnsiEscapeCode FONT_7
public static final AnsiEscapeCode FONT_8
public static final AnsiEscapeCode FONT_9
public static final AnsiEscapeCode FRAKTUR
public static final AnsiEscapeCode DOUBLY_UNDERLINE_OR_BOLD_OFF
public static final AnsiEscapeCode NORMAL_COLOR_OR_INTENSITY
public static final AnsiEscapeCode NOT_ITALIC_NOT_FRAKTUR
public static final AnsiEscapeCode UNDERLINE_OFF
public static final AnsiEscapeCode BLINK_OFF
public static final AnsiEscapeCode INVERSE_OFF
public static final AnsiEscapeCode REVEAL
public static final AnsiEscapeCode NOT_CROSSED_OUT
public static final AnsiEscapeCode FG_BLACK
public static final AnsiEscapeCode FG_RED
public static final AnsiEscapeCode FG_GREEN
public static final AnsiEscapeCode FG_YELLOW
public static final AnsiEscapeCode FG_BLUE
public static final AnsiEscapeCode FG_MAGENTA
public static final AnsiEscapeCode FG_CYAN
public static final AnsiEscapeCode FG_WHITE
public static final AnsiEscapeCode SET_FOREGROUND_COLOR
5;n or
2;r;g;b, see below:
ESC[38:5:(n)m: Select foreground color, (n) represents
an index into a predefined 256-color lookup table
ESC[38;2;(r);(g);(b)m: Select RGB foreground color, (r)
represents the 8 bit red portion of an RGB color, (g) represents the 8
bit green portion of an RGB color, (b) represents the 8 bit blue portion
of an RGB color
public static final AnsiEscapeCode DEFAULT_FOREGROUND_COLOR
public static final AnsiEscapeCode BG_BLACK
public static final AnsiEscapeCode BG_RED
public static final AnsiEscapeCode BG_GREEN
public static final AnsiEscapeCode BG_YELLOW
public static final AnsiEscapeCode BG_BLUE
public static final AnsiEscapeCode BG_MAGENTA
public static final AnsiEscapeCode BG_CYAN
public static final AnsiEscapeCode BG_WHITE
public static final AnsiEscapeCode SET_BACKGROUND_COLOR
5;n or
2;r;g;b, see below:
ESC[48:5:(n)m; Select background color, (n) represents
an index into a predefined 256-color lookup table
ESC[48;2;(r);(g);(b)m: Select RGB background color, (r)
represents the 8 bit red portion of an RGB color, (g) represents the 8
bit green portion of an RGB color, (b) represents the 8 bit blue portion
of an RGB color
public static final AnsiEscapeCode DEFAULT_BACKGROUND_COLOR
public static final AnsiEscapeCode FRAMED
public static final AnsiEscapeCode ENCIRCLED
public static final AnsiEscapeCode OVERLINED
public static final AnsiEscapeCode NOT_FRAMED
public static final AnsiEscapeCode NOT_OVERLINED
public static final AnsiEscapeCode IDEOGRAM_UNDERLINE_OR_RIGHT_SIDE_LINE
public static final AnsiEscapeCode IDEOGRAM_DOUBLE_UNDERLINE_OR_DOUBLE_LINE_ON_THE_RIGHT_SIDE
public static final AnsiEscapeCode IDEOGRAM_OVERLINE_OR_LEFT_SIDE_LINE
public static final AnsiEscapeCode IDEOGRAM_DOUBLE_OVERLINE_OR_DOUBLE_LINE_ON_THE_LEFT_SIDE
public static final AnsiEscapeCode IDEOGRAM_STRESS_MARKING
public static final AnsiEscapeCode IDEOGRAM_ATTRIBUTES_OFF
public static final AnsiEscapeCode FG_BRIGHT_BLACK
public static final AnsiEscapeCode FG_BRIGHT_RED
public static final AnsiEscapeCode FG_BRIGHT_GREEN
public static final AnsiEscapeCode FG_BRIGHT_YELLOW
public static final AnsiEscapeCode FG_BRIGHT_BLUE
public static final AnsiEscapeCode FG_BRIGHT_MAGENTA
public static final AnsiEscapeCode FG_BRIGHT_CYAN
public static final AnsiEscapeCode FG_BRIGHT_WHITE
public static final AnsiEscapeCode FG_BRIGHT_DEFAULT
public static final AnsiEscapeCode BG_BRIGHT_BLACK
public static final AnsiEscapeCode BG_BRIGHT_RED
public static final AnsiEscapeCode BG_BRIGHT_GREEN
public static final AnsiEscapeCode BG_BRIGHT_YELLOW
public static final AnsiEscapeCode BG_BRIGHT_BLUE
public static final AnsiEscapeCode BG_BRIGHT_MAGENTA
public static final AnsiEscapeCode BG_BRIGHT_CYAN
public static final AnsiEscapeCode BG_BRIGHT_WHITE
public static final AnsiEscapeCode BG_BRIGHT_DEFAULT
public static char ESCAPE
public static char ESCAPE_SUFFIX
public static char ESCAPE_PARAMETER_DELIMITER
<ESC>[0;1;4m".public static char ESCAPE_PREFIX_DELIMITER
<ESC>[0;1;4m".public static char RGB_COLOR_SELECTOR_PARAMETER
SET_FOREGROUND_COLOR or
SET_BACKGROUND_COLOR, the RGB_COLOR_SELECTOR_PARAMETER
specifies that the succeeding parameters represent RGB values.public static char COLOR_TABLE_SELECTOR_PARAMETER
SET_FOREGROUND_COLOR or
SET_BACKGROUND_COLOR, the
COLOR_TABLE_SELECTOR_PARAMETER specifies that the succeeding
parameter represents an index into the ANSI Color-Table.public static AnsiEscapeCode[] values()
for (AnsiEscapeCode c : AnsiEscapeCode.values()) System.out.println(c);
public static AnsiEscapeCode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Byte getCode()
getCode in interface org.refcodes.mixin.CodeAccessor<Byte>public static String toEscapeSequence(AnsiEscapeCode... aAnsiEscapeCodes)
AnsiEscapeCode elements directly printable to
System.out. This method can only provide placeholder such as
${n0}, ${n1}, ... for elements SET_FOREGROUND_COLOR and
SET_BACKGROUND_COLOR (the numbers correspond to the order of
their appearance). Consider building your sequence manually in case you
want to use a RGB value instead of an index into the ANSI Color-Table.aAnsiEscapeCodes - The Escape-Codes to be included in the
Escape-Code sequence.System.out.public static String toEscapedSequence(String aEscapeSequence)
ESCAPE code with a printable char sequence. This means that the
Escape-Sequence is disabled so that it will be printed out as plain text.aEscapeSequence - The Escape-Sequence to be printed out as plain
text.public static Region[] toEscapedSequenceRegions(String aEscapedString)
public static String toUnescapedString(String aEscapedString)
String.public static int toUnescapedLength(String aEscapedString)
public String toEscaped()
Copyright © 2021. All rights reserved.