Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- enum class color {
- black, blue, green, aqua,
- red, purple, yellow, white,
- gray, light_blue, light_green, light_aqua,
- light_red, light_purple, light_yellow, bright_white
- };
- void set_color(color new_color) {
- HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(handle, static_cast<WORD>(new_color));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement