Color

Undocumented in source.

Members

Functions

ansi
AnsiColor ansi()
Undocumented in source. Be warned that the author may not have intended to support it.
rgb
RGB rgb()
Undocumented in source. Be warned that the author may not have intended to support it.
state
ColorState state()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

rgb
Color rgb(ubyte r, ubyte g, ubyte b)
Undocumented in source. Be warned that the author may not have intended to support it.
same
Color same()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

Color a;
assert(a.colorState == ColorState.ansi);
assert(a.ansiColor == AnsiColor.initial);
assert(a.state() == ColorState.ansi);
assert(a.ansi() == AnsiColor.initial);
assert(a.rgbColor.isNull());

Color b = Color.red;
assert(b.colorState == ColorState.ansi);
assert(b.ansiColor == AnsiColor.red);
assert(b.state() == ColorState.ansi);
assert(b.ansi() == AnsiColor.red);
assert(b.rgbColor.isNull());

version (Posix)
{
    Color c = Color.rgb(123, 232, 123);
    assert(c.colorState == ColorState.rgb);
    assert(c.state() == ColorState.rgb);
    assert(c.ansiColor.isNull());
    assert(c.rgbColor == RGB(123, 232, 123));
    assert(c.rgb() == RGB(123, 232, 123));
}

Color d = Color.same;
assert(d.colorState == ColorState.same);
assert(d.state() == ColorState.same);
assert(d.ansiColor.isNull());
assert(d.rgbColor.isNull());

Meta