The console only supports 16 colors, which are created by combining the four values as follows (I might have got the gray/darkgray confused, but you get the idea):
namespace ConsoleForeground
{
enum {
BLACK = 0,
DARKBLUE = FOREGROUND_BLUE,
DARKGREEN = FOREGROUND_GREEN,
DARKCYAN = FOREGROUND_GREEN | FOREGROUND_BLUE,
DARKRED = FOREGROUND_RED,
DARKMAGENTA = FOREGROUND_RED | FOREGROUND_BLUE,
DARKYELLOW = FOREGROUND_RED | FOREGROUND_GREEN,
DARKGRAY = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
GRAY = FOREGROUND_INTENSITY,
BLUE = FOREGROUND_INTENSITY | FOREGROUND_BLUE,
GREEN = FOREGROUND_INTENSITY | FOREGROUND_GREEN,
CYAN = FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_BLUE,
RED = FOREGROUND_INTENSITY | FOREGROUND_RED,
MAGENTA = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE,
YELLOW = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN,
WHITE = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE,
};
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…