11 #if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__)
13 #elif defined(_WIN32) || defined(_WIN64)
21 #if defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__)
22 const char* colors[] =
41 const char* backgrounds[] =
60 std::fwrite(backgrounds[(
int)background - (
int)
Color::BLACK], 1, 8, stdout);
61 std::fwrite(colors[(
int)color - (
int)
Color::BLACK], 1, 8, stdout);
62 #elif defined(_WIN32) || defined(_WIN64)
63 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
64 SetConsoleTextAttribute(hConsole, (((WORD)color) & 0x0F) + ((((WORD)background) & 0x0F) << 4));
static void SetColor(Color color, Color background=Color::BLACK)
Set console text color.
Console management definition.
C++ Benchmark project definitions.
Color
Supported console colors.