1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <windows.h>
using namespace std;
using namespace System;
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
/*
black, // 0
dark_blue, // 1
dark_green, // 2
dark_cyan, // 3
dark_red, // 4
dark_magenta, // 5
dark_yellow, // 6
light_gray, // 7
dark_gray, // 8
light_blue, // 9
light_green, // 10
light_cyan, // 11
light_red, // 12
light_magenta, // 13
light_yellow, // 14
white // 15
*/
// To get the color desired, take the number for background color desired, multiplied by 16.
// Then add number for the foreground.
// Like so : int color = (f_color+(b_color*16));
SetConsoleTextAttribute(console, color);
|