toBg

Converts any suitable data type into an AnsiColour.

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).toBg == AnsiColour(255, 128, 64, IsBgColour.yes));
static struct RGB
{
    ubyte r;
    ubyte g;
    ubyte b;
}

assert(RGB(255, 128, 64).to!AnsiColour == AnsiColour(255, 128, 64));

See Also

isUserDefinedRgbType

Meta