This class provides functionality for applying ANSI codes to strings for terminal output.

Static methods

staticapply(str:String, code:AnsiCode):String

Applies the specified ANSI codes to the input string.

You can pass one or multiple ANSI codes for combining styles.

Parameters:

str

The input string.

code

The ANSI codes to apply.

Returns:

The styled string.

staticinlinebg_black(str:String):String

Sets the background color to black.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_blue(str:String):String

Sets the background color to blue.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_black(str:String):String

Sets the background color to bright black (gray).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_blue(str:String):String

Sets the background color to bright blue.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_cyan(str:String):String

Sets the background color to bright cyan.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_green(str:String):String

Sets the background color to bright green.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_lilac(str:String):String

Sets the background color to bright lilac (256-color mode).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_magenta(str:String):String

Sets the background color to bright magenta.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_red(str:String):String

Sets the background color to bright red.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_white(str:String):String

Sets the background color to bright white.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_bright_yellow(str:String):String

Sets the background color to bright yellow.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_cyan(str:String):String

Sets the background color to cyan.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_green(str:String):String

Sets the background color to green.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_magenta(str:String):String

Sets the background color to magenta.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_note_down(str:String):String

Sets the background color to the color of a Down note.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_note_left(str:String):String

Sets the background color to the color of a Left note.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_note_right(str:String):String

Sets the background color to the color of a Right note.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_note_up(str:String):String

Sets the background color to the color of a Up note.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_orange(str:String):String

Sets the background color to orange (256-color mode).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_purple(str:String):String

Sets the background color to purple (256-color mode).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_red(str:String):String

Sets the background color to red.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_white(str:String):String

Sets the background color to white.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebg_yellow(str:String):String

Sets the background color to yellow.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineblack(str:String):String

Colors the string black.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineblink(str:String):String

Makes the string blink. (Not widely supported on modern terminals.)

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineblue(str:String):String

Colors the string blue.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebold(str:String):String

Makes the string bold.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_black(str:String):String

Colors the string bright black (gray).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_blue(str:String):String

Colors the string bright blue.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_cyan(str:String):String

Colors the string bright cyan.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_green(str:String):String

Colors the string bright green.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_magenta(str:String):String

Colors the string bright magenta.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_red(str:String):String

Colors the string bright red.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_white(str:String):String

Colors the string bright white.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinebright_yellow(str:String):String

Colors the string bright yellow.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinecyan(str:String):String

Colors the string cyan.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinedim(str:String):String

Makes the string dim/faint.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineerror(str:String):String

Makes the string display as ERROR text.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinegreen(str:String):String

Colors the string green.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinehidden(str:String):String

Hides the string (renders it invisible in many terminals).

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineinfo(str:String):String

Makes the string display as INFO text.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineinverse(str:String):String

Inverts the foreground and background colors of the string.

Parameters:

str

The input string to format.

Returns:

The formatted string.

@SuppressWarnings(["checkstyle:SimplifyBooleanExpression"])staticisColorCodesSupported():Bool

Whether ANSI codes are supported or not.

Returns:

true if ANSI codes are supported, false otherwise.

staticinlinemagenta(str:String):String

Colors the string magenta.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinered(str:String):String

Colors the string red.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinestrikethrough(str:String):String

Applies a strikethrough effect to the string.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineunderline(str:String):String

Underlines the string.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinewarning(str:String):String

Makes the string display as WARNING text.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlinewhite(str:String):String

Colors the string white.

Parameters:

str

The input string to format.

Returns:

The formatted string.

staticinlineyellow(str:String):String

Colors the string yellow.

Parameters:

str

The input string to format.

Returns:

The formatted string.