AnsiColour

Contains either a 4-bit, 8-bit, or 24-bit colour, which can then be turned into an its ANSI form (not a valid command, just the actual values needed to form the final command).

Constructors

this
this(Ansi4BitColour fourBit, IsBgColour isBg)

Ctor for an AnsiColourType.fourBit.

this
this(ubyte eightBit, IsBgColour isBg)

Ctor for an AnsiColourType.eightBit

this
this(ubyte r, ubyte g, ubyte b, IsBgColour isBg)
this(AnsiRgbColour rgb, IsBgColour isBg)

Ctor for an AnsiColourType.rgb.

Members

Functions

toString
string toString()

Notes: To create a valid ANSI command from these values, prefix it with "\033[" and suffix it with "m", then place your text after it.

Properties

asEightBit
ubyte asEightBit [@property getter]

Assertions: This colour's type must be AnsiColourType.eightBit

asFourBit
Ansi4BitColour asFourBit [@property getter]

Assertions: This colour's type must be AnsiColourType.fourBit

asRgb
AnsiRgbColour asRgb [@property getter]

Assertions: This colour's type must be AnsiColourType.rgb

isBg
IsBgColour isBg [@property getter]
IsBgColour isBg [@property setter]
bool isBg [@property setter]
type
AnsiColourType type [@property getter]

Static variables

bgInit
auto bgInit;

A variant of .init that is used for background colours.

Meta