| 20 | namespace spvtools { |
| 21 | |
| 22 | static void SetConsoleForegroundColorPrimary(HANDLE hConsole, WORD color) { |
| 23 | // Get screen buffer information from console handle |
| 24 | CONSOLE_SCREEN_BUFFER_INFO bufInfo; |
| 25 | GetConsoleScreenBufferInfo(hConsole, &bufInfo); |
| 26 | |
| 27 | // Get background color |
| 28 | color = WORD(color | (bufInfo.wAttributes & 0xfff0)); |
| 29 | |
| 30 | // Set foreground color |
| 31 | SetConsoleTextAttribute(hConsole, color); |
| 32 | } |
| 33 | |
| 34 | static void SetConsoleForegroundColor(WORD color) { |
| 35 | SetConsoleForegroundColorPrimary(GetStdHandle(STD_OUTPUT_HANDLE), color); |
no outgoing calls
no test coverage detected