toBg

Converts any suitable data type into an AnsiColour.

  1. AnsiColour to(CT colour)
  2. AnsiColour toBg(T c)
    toBg
    (
    T
    )
    (
    T c
    )

Return Value

An AnsiColour created from the given colour.

Examples

static struct RGB
{
    ubyte r;
    ubyte g;
    ubyte b;
}

assert(RGB(255, 128, 64).to!AnsiColour == AnsiColour(255, 128, 64));
static struct RGB
{
    ubyte r;
    ubyte g;
    ubyte b;
}

assert(RGB(255, 128, 64).toBg == AnsiColour(255, 128, 64, IsBgColour.yes));

See Also

isUserDefinedRgbType

Meta