-
Notifications
You must be signed in to change notification settings - Fork 0
/
Colors.h
92 lines (90 loc) · 1.73 KB
/
Colors.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef COLORS_H_INCLUDED
#define COLORS_H_INCLUDED
#include <windows.h>
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
// text color from 0x1-0x9
// text background color from 0x10-0x90
/* Name FG BG
* Black 30 40
* Red 31 41
* Green 32 42
* Yellow 33 43
* Blue 34 44
* Magenta 35 45
* Cyan 36 46
* White 37 47
* Bright Black 90 100
* Bright Red 91 101
* Bright Green 92 102
* Bright Yellow 93 103
* Bright Blue 94 104
* Bright Magenta 95 105
* Bright Cyan 96 106
* Bright White 97 107
*/
inline void black()
{
SetConsoleTextAttribute(h,240);
}
inline void blue()
{
SetConsoleTextAttribute(h,241);
}
inline void green()
{
SetConsoleTextAttribute(h,242);
}
inline void cyan()
{
SetConsoleTextAttribute(h,243);
}
inline void red()
{
SetConsoleTextAttribute(h,244);
}
inline void purple()
{
SetConsoleTextAttribute(h,245);
}
inline void yellow()
{
SetConsoleTextAttribute(h,246);
}
inline void white()
{
SetConsoleTextAttribute(h,247);
}
//lighter shaded
inline void gray()
{
SetConsoleTextAttribute(h,248);
}
inline void lightblue()
{
SetConsoleTextAttribute(h,249);
}
inline void lightgreen()
{
SetConsoleTextAttribute(h,250);
}
inline void lightcyan()
{
SetConsoleTextAttribute(h,251);
}
inline void lightred()
{
SetConsoleTextAttribute(h,252);
}
inline void lightpurple()
{
SetConsoleTextAttribute(h,253);
}
inline void lightyellow()
{
SetConsoleTextAttribute(h,254);
}
inline void lightwhite()
{
SetConsoleTextAttribute(h,255);
}
#endif // COLORS_H_INCLUDED