Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs AnsiStyleSet

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module 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;
    
}

Documentation

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

Constants

Name Description
MAX_CHARS_NEEDED

The maximum amount of characters any singular AnsiStylesequence may use.

Functions

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.