Sets the foreground/background as a 4-bit colour. Widest supported option.
Sets the foreground/background as an 8-bit colour. Please see this image for reference: https://i.stack.imgur.com/KTSQa.png
Sets the forground/background as an RGB colour.
Sets the forground/background to an AnsiColour. Background colours will have their isBg flag set automatically.
Gets the AnsiColour used as the background.
Sets whether the text is bold.
Sets whether the text is dimmed (opposite of bold).
Sets whether the text should blink rapidly.
Sets the foreground/background as a 4-bit colour. Widest supported option.
Sets the foreground/background as an 8-bit colour. Please see this image for reference: https://i.stack.imgur.com/KTSQa.png
Sets the forground/background as an RGB colour.
Sets the forground/background to an AnsiColour. Background colours will have their isBg flag set automatically.
Gets the AnsiColour used as the foreground (text colour).
Sets whether the text should have its fg and bg colours inverted.
Sets whether the text should be displayed in italics.
Sets the AnsiTextFlags for this piece of text.
Sets whether the text should blink slowly.
Sets whether the text should have a strike through it.
Notes: If no ANSI escape codes are used, then this function will simply return a .idup of the text provided to this struct's constructor.
Sets whether the text has an underline.
Gets the AnsiTextFlags for this piece of text.
Sets the raw text used.
The ANSI command to reset all styling.
A struct used to compose together a piece of ANSI text.
Notes: A reset command (\033[0m) is automatically appended, so you don't have to worry about that.
This struct is simply a wrapper around AnsiColour, AnsiTextFlags types, and the populateActiveAnsiComponents and createAnsiCommandString functions.
Usage: This struct uses the Fluent Builder pattern, so you can easily string together its various functions when creating your text.
Set the background colour with AnsiText.bg
Set the foreground/text colour with AnsiText.fg
AnsiText uses toString to provide the final output, making it easily used with the likes of writeln and format.