![]() |
C++ text color include for Windows enviroment
1 Attachment(s)
I was messing with some things yesterday and got somewhat annoyed at the fact that while there is a way to change text and background color in a Windows console enviroment (for specific parts of the text rather than the whole thing at once), it's slightly unintuitive for the end user.
So, I cooked up a custom include with a few functions and definitions that make the color-changing a breeze: (Attached as textcolor.h ) Note that negative argument values are used to reset the setting to default. |
Some incomplete attempt to make it into a iomanipulator, didn't try if it compiles on Windows as I wrote it on Linux. Use it only with std::cout!
Code:
#include <iosfwd> Put directly below the above "header" Code:
#include <iostream> |
The current time is 01:03 AM (GMT) |
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.