Text-Styling
In the terminal there are certain text attributes for each cell that can be set. These include the foreground/background color and text fonts.
All functions in this topic support non-native based terminal instances!
TerminalColor
The TerminalColor
class reflects a color for the foreground und background. There is also a return method to call the respective Ansi-code that is responsible for changing the text attributes.
TerminalColor.BLACK
TerminalColor.DARK_RED
TerminalColor.DARK_GREEN
TerminalColor.DARK_YELLOW
TerminalColor.DARK_BLUE
TerminalColor.DARK_PURPLE
TerminalColor.DARK_AQUA
TerminalColor.GRAY
TerminalColor.DARK_GRAY
TerminalColor.RED
TerminalColor.GREEN
TerminalColor.YELLOW
TerminalColor.BLUE
TerminalColor.PURPLE
TerminalColor.AQUA
TerminalColor.WHITE
TerminalColor.DEFAULT
represents the default color for the foreground and background, which is set as the default color in the terminal application.
A color can also be generated by the RGB color model but may not be displayed in many terminals. The colors from xterm-256color can be used for safe resolutions. This color palette offers 256 possible colors that can be displayed in most terminals.
Create rgb color: TerminalColor.from(r,g,b)
TerminalColor.from(hex)
Convert a color to xterm 256color: TerminalColor#asXtermColor()

Xterm-256color generating:
XtermColor.getNearestTo(AWTColor)
XtermColor.getColor(id:byte)
Text-Font
The TextFont
enum list all font types:
With TextFont.getDefaultFont()
an Ansi-Code is returned that resets the font attributes.
TextStyle class
The TextStyle class contains all attributes to describe a certain text style.
Example code using a mixture of several styles:

When using the combiner class, all attributes can be overwritten if the attributes of the higher prioritized style object do not equal to null.

TermString class
The TermString class contains a string with the associated style data and simplifies the use of terminal-based strings.

