termcolor

Hackish library to colorize standard output.

Members

Enums

C
enum C

All colors

Functions

bg
string bg(C color)
Undocumented in source. Be warned that the author may not have intended to support it.
fg
string fg(C color)
Undocumented in source. Be warned that the author may not have intended to support it.
resetColor
string resetColor()
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

import termcolor;
import std.stdio : write, writeln;
import std.traits : EnumMembers;
writeln("Written in ", C.green.fg, "green color and ", C.blackDark.bg, "dark background", resetColor, "!");

// show all color combinations
foreach(f; EnumMembers!C) {
    foreach(b; EnumMembers!C) {
        write(f.fg, b.bg, "foo", resetColor(), " ");
    }
    writeln();
}

Meta