Files
MIRROR-LX-OriginalRepo/Common/src/IO.cpp
2025-05-07 16:53:10 +01:00

20 lines
442 B
C++

#include <LX-Common.h>
namespace LX
{
void PrintStringAsColor(const std::string& str, Color c)
{
// Gets a handle to the console //
static HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// Sets the color of the console to the desired color //
SetConsoleTextAttribute(hConsole, (WORD)c);
// Outputs the text //
std::cout << str;
// Resets the color //
SetConsoleTextAttribute(hConsole, (WORD)Color::LIGHT_GRAY);
}
}