aboutsummaryrefslogtreecommitdiff
path: root/include/kpl/color.h
blob: 1f77dcbcb566469ecf980fa0a44ae1b5f8017415 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119

#pragma once

// C string pretty printing macros

#define KPL_COLOR_CONCAT(COLOR) KPL_COLOR_ ## COLOR

#ifndef KPL_COLOR_OFF

#define KPL_COLOR(A) "\e[" KPL_COLOR_CONCAT(A) "m"
#define KPL_COLOR2(A, B) "\e[" KPL_COLOR_CONCAT(A) ";" KPL_COLOR_CONCAT(B) "m"
#define KPL_COLOR3(A, B, C) "\e[" KPL_COLOR_CONCAT(A) ";" KPL_COLOR_CONCAT(B) ";" KPL_COLOR_CONCAT(C) "m"

#define KPL_COLOR_RESET             "0"
#define KPL_COLOR_BOLD              "1"
#define KPL_COLOR_FAINT             "2"
#define KPL_COLOR_ITALIC            "3"
#define KPL_COLOR_UNDERLINE         "4"
#define KPL_COLOR_BLINK             "5"
#define KPL_COLOR_REVERSE           "7"
#define KPL_COLOR_HIDDEN            "8"
#define KPL_COLOR_RESET_BOLD        "21"
#define KPL_COLOR_RESET_FAINT       "22"
#define KPL_COLOR_RESET_ITALIC      "23"
#define KPL_COLOR_RESET_UNDERLINE   "24"
#define KPL_COLOR_RESET_BLINK       "25"
#define KPL_COLOR_RESET_REVERSE     "27"
#define KPL_COLOR_RESET_HIDDEN      "28"
#define KPL_COLOR_BLACK             "30"
#define KPL_COLOR_RED               "31"
#define KPL_COLOR_GREEN             "32"
#define KPL_COLOR_YELLOW            "33"
#define KPL_COLOR_BLUE              "34"
#define KPL_COLOR_MAGENTA           "35"
#define KPL_COLOR_CYAN              "36"
#define KPL_COLOR_GREY              "37"
#define KPL_COLOR_DEFAULT           "39"
#define KPL_COLOR_BG_BLACK          "30"
#define KPL_COLOR_BG_RED            "41"
#define KPL_COLOR_BG_GREEN          "42"
#define KPL_COLOR_BG_YELLOW         "43"
#define KPL_COLOR_BG_BLUE           "44"
#define KPL_COLOR_BG_MAGENTA        "45"
#define KPL_COLOR_BG_CYAN           "46"
#define KPL_COLOR_BG_GREY           "47"
#define KPL_COLOR_DARK_GREY         "90"
#define KPL_COLOR_LIGHT_RED         "91"
#define KPL_COLOR_LIGHT_GREEN       "92"
#define KPL_COLOR_LIGHT_YELLOW      "93"
#define KPL_COLOR_LIGHT_BLUE        "94"
#define KPL_COLOR_LIGHT_MAGENTA     "95"
#define KPL_COLOR_LIGHT_CYAN        "96"
#define KPL_COLOR_WHITE             "97"
#define KPL_COLOR_BG_DARK_GREY      "100"
#define KPL_COLOR_BG_LIGHT_RED      "101"
#define KPL_COLOR_BG_LIGHT_GREEN    "102"
#define KPL_COLOR_BG_LIGHT_YELLOW   "103"
#define KPL_COLOR_BG_LIGHT_BLUE     "104"
#define KPL_COLOR_BG_LIGHT_MAGENTA  "105"
#define KPL_COLOR_BG_LIGHT_CYAN     "106"
#define KPL_COLOR_BG_WHITE          "107"

#else

#define KPL_COLOR(A) KPL_COLOR_CONCAT(A)
#define KPL_COLOR2(A, B) KPL_COLOR_CONCAT(A) KPL_COLOR_CONCAT(B)
#define KPL_COLOR3(A, B, C) KPL_COLOR_CONCAT(A) KPL_COLOR_CONCAT(B) KPL_COLOR_CONCAT(C)


#define KPL_COLOR_RESET             ""
#define KPL_COLOR_BOLD              ""
#define KPL_COLOR_FAINT             ""
#define KPL_COLOR_ITALIC            ""
#define KPL_COLOR_UNDERLINE         ""
#define KPL_COLOR_BLINK             ""
#define KPL_COLOR_REVERSE           ""
#define KPL_COLOR_HIDDEN            ""
#define KPL_COLOR_RESET_BOLD        ""
#define KPL_COLOR_RESET_FAINT       ""
#define KPL_COLOR_RESET_ITALIC      ""
#define KPL_COLOR_RESET_UNDERLINE   ""
#define KPL_COLOR_RESET_BLINK       ""
#define KPL_COLOR_RESET_REVERSE     ""
#define KPL_COLOR_RESET_HIDDEN      ""
#define KPL_COLOR_BLACK             ""
#define KPL_COLOR_RED               ""
#define KPL_COLOR_GREEN             ""
#define KPL_COLOR_YELLOW            ""
#define KPL_COLOR_BLUE              ""
#define KPL_COLOR_MAGENTA           ""
#define KPL_COLOR_CYAN              ""
#define KPL_COLOR_GREY              ""
#define KPL_COLOR_DEFAULT           ""
#define KPL_COLOR_BG_BLACK          ""
#define KPL_COLOR_BG_RED            ""
#define KPL_COLOR_BG_GREEN          ""
#define KPL_COLOR_BG_YELLOW         ""
#define KPL_COLOR_BG_BLUE           ""
#define KPL_COLOR_BG_MAGENTA        ""
#define KPL_COLOR_BG_CYAN           ""
#define KPL_COLOR_BG_GREY           ""
#define KPL_COLOR_DARK_GREY         ""
#define KPL_COLOR_LIGHT_RED         ""
#define KPL_COLOR_LIGHT_GREEN       ""
#define KPL_COLOR_LIGHT_YELLOW      ""
#define KPL_COLOR_LIGHT_BLUE        ""
#define KPL_COLOR_LIGHT_MAGENTA     ""
#define KPL_COLOR_LIGHT_CYAN        ""
#define KPL_COLOR_WHITE             ""
#define KPL_COLOR_BG_DARK_GREY      ""
#define KPL_COLOR_BG_LIGHT_RED      ""
#define KPL_COLOR_BG_LIGHT_GREEN    ""
#define KPL_COLOR_BG_LIGHT_YELLOW   ""
#define KPL_COLOR_BG_LIGHT_BLUE     ""
#define KPL_COLOR_BG_LIGHT_MAGENTA  ""
#define KPL_COLOR_BG_LIGHT_CYAN     ""
#define KPL_COLOR_BG_WHITE          ""

#endif