123456789101112131415161718192021222324252627282930313233343536373839module juptune.core.util.ansi;
nothrow @safe @nogc struct AnsiStyleSet
{
/++ FUNCTIONS ++/
/// SETTERS
AnsiStyleSet bg(AnsiColour colour);
/// SETTERS
AnsiStyleSet bg(Ansi4BitColour colour);
/// SETTERS
AnsiStyleSet bg(ubyte colour);
/// SETTERS
AnsiStyleSet bg(AnsiRgbColour colour);
/// GETTERS
AnsiColour bg();
/// SETTERS
AnsiStyleSet fg(AnsiColour colour);
/// SETTERS
AnsiStyleSet fg(Ansi4BitColour colour);
/// SETTERS
AnsiStyleSet fg(ubyte colour);
/// SETTERS
AnsiStyleSet fg(AnsiRgbColour colour);
/// GETTERS
AnsiColour fg();
/// SETTERS
AnsiStyleSet style(AnsiStyle style);
/// GETTERS
AnsiStyle style();
/// OUTPUT Creates an ANSI SGR command that sets the foreground colour, sets the background colour, and enables all of the desired styling options, while leaving all of the other options unchanged.
char[] toSequence(char[50LU] buffer);
/++ MANIFEST CONSTANTS ++/
/// The maximum amount of characters any singular AnsiStyle sequence may use.
enum ulong MAX_CHARS_NEEDED = 50LU;
}
DATA WITH COLOUR TYPES
Contains an AnsiColourfor the foreground, an AnsiColourfor the background, and an AnsiStylefor additional styling, and provides the ability to create an ANSI SGR command to set the foreground, background, and overall styling of the terminal.
A.k.a This is just a container over two AnsiColours and an AnsiStyle.
CONSTANTS
| Name | Description |
|---|---|
| MAX_CHARS_NEEDED |
The maximum amount of characters any singular |
| Name | Description |
|---|---|
| bg |
SETTERS |
| bg |
SETTERS |
| bg |
SETTERS |
| bg |
SETTERS |
| bg |
GETTERS |
| fg |
SETTERS |
| fg |
SETTERS |
| fg |
SETTERS |
| fg |
SETTERS |
| fg |
GETTERS |
| style |
SETTERS |
| style |
GETTERS |
| toSequence |
OUTPUT Creates an ANSI SGR command that sets the foreground colour, sets the background colour, and enables all of the desired styling options, while leaving all of the other options unchanged. |