module lunch.color;


string black()
{
    return "\x1B[30m";
}

string red()
{
    return "\x1B[31m";
}

string green()
{
    return "\x1B[32m";
}

string yellow()
{
    return "\x1B[33m";
}

string blue()
{
    return "\x1B[34m";
}

string magenta()
{
    return "\x1B[35m";
}

string cyan()
{
    return "\x1B[36m";
}

string white()
{
    return "\x1B[37m";
}

string brightBlack()
{
    return "\x1B[90m";
}

string brightRed()
{
    return "\x1B[91m";
}

string brightGreen()
{
    return "\x1B[92m";
}

string brightYellow()
{
    return "\x1B[93m";
}

string brightBlue()
{
    return "\x1B[94m";
}

string brightMagenta()
{
    return "\x1B[95m";
}

string brightCyan()
{
    return "\x1B[96m";
}

string brightWhite()
{
    return "\x1B[97m";
}

string reset()
{
    return "\x1B[0m";
}


const(char)[] black(const(char)[] str)
{
    return "\x1B[30m" ~ str ~ "\x1B[0m";
}

const(char)[] red(const(char)[] str)
{
    return "\x1B[31m" ~ str ~ "\x1B[0m";
}

const(char)[] green(const(char)[] str)
{
    return "\x1B[32m" ~ str ~ "\x1B[0m";
}

const(char)[] yellow(const(char)[] str)
{
    return "\x1B[33m" ~ str ~ "\x1B[0m";
}

const(char)[] blue(const(char)[] str)
{
    return "\x1B[34m" ~ str ~ "\x1B[0m";
}

const(char)[] magenta(const(char)[] str)
{
    return "\x1B[35m" ~ str ~ "\x1B[0m";
}

const(char)[] cyan(const(char)[] str)
{
    return "\x1B[36m" ~ str ~ "\x1B[0m";
}

const(char)[] white(const(char)[] str)
{
    return "\x1B[37m" ~ str ~ "\x1B[0m";
}

const(char)[] brightBlack(const(char)[] str)
{
    return "\x1B[90m" ~ str ~ "\x1B[0m";
}

const(char)[] brightRed(const(char)[] str)
{
    return "\x1B[91m" ~ str ~ "\x1B[0m";
}

const(char)[] brightGreen(const(char)[] str)
{
    return "\x1B[92m" ~ str ~ "\x1B[0m";
}

const(char)[] brightYellow(const(char)[] str)
{
    return "\x1B[93m" ~ str ~ "\x1B[0m";
}

const(char)[] brightBlue(const(char)[] str)
{
    return "\x1B[94m" ~ str ~ "\x1B[0m";
}

const(char)[] brightMagenta(const(char)[] str)
{
    return "\x1B[95m" ~ str ~ "\x1B[0m";
}

const(char)[] brightCyan(const(char)[] str)
{
    return "\x1B[96m" ~ str ~ "\x1B[0m";
}

const(char)[] brightWhite(const(char)[] str)
{
    return "\x1B[97m" ~ str ~ "\x1B[0m";
}


shared static this()
{
    version (Windows)
    {
        import core.stdc.stdlib;
        import core.sys.windows.windows;

        // Are we attached to console?
        if (GetConsoleWindow())
            // Then run `color` to enable colors :)
            system("color");
    }
}
