Once upon a time there was a library for styling text in the console, e.g. for some old school text games, but I can't remember the name, maybe you can find it on google.
You can also use the windows.h library:
Code:
void printInColor(const std::string& text, WORD color)
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, color);
std::cout << text << std::endl;
Set consoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
}
Code:
#include <iostream>
#include <windows.h>
int main()
{
printInColor("Example player has logged in", FOREGROUND_GREEN);
printInColor("Example player has logged out", FOREGROUND_RED | FOREGROUND_INTENSITY);
return 0;
}
more about this:
How can I write colored text to the console with C++? That is, how can I write different text with different colors?
stackoverflow.com
Sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function.
learn.microsoft.com
When I was still playing with the OTS, I used to dream of such a powerful admin panel, with a console, with statistical posts and various counters and compasses but I guess there was no such thing 15 years ago