20 int descriptor = is_error ? STD_ERROR_HANDLE : STD_OUTPUT_HANDLE;
21 std::ostream &stream = is_error ? std::cerr : std::cout;
26 HANDLE hConsole = GetStdHandle(descriptor);
27 FlushConsoleInputBuffer(hConsole);
28 SetConsoleTextAttribute(hConsole, color);
32 FlushConsoleInputBuffer(hConsole);
33 SetConsoleTextAttribute(hConsole, old_color);
34 FlushConsoleInputBuffer(hConsole);