This repository was archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathColorized.hpp
154 lines (138 loc) · 4.36 KB
/
Colorized.hpp
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* MIT License
# Forked from https://github.com/ferhatgec/colorized
# (Removed unused namespace and functions)
# Copyright (c) 2020 Ferhat Geçdoğan All Rights Reserved.
# Distributed under the terms of the MIT License.
#
# */
#ifndef COLORIZED_HPP
#define COLORIZED_HPP
#include <cstring>
#include <iostream>
#include <sstream>
#define ESC 033
// Default Background color definitions
#define DEFAULT 39
#define BLACK 30
#define RED 31
#define GREEN 32
#define YELLOW 33
#define BLUE 34
#define MAGENTA 35
#define CYAN 36
#define WHITE 37
#define LIGHT_BLACK 90
#define LIGHT_RED 91
#define LIGHT_GREEN 92
#define LIGHT_YELLOW 93
#define LIGHT_BLUE 94
#define LIGHT_MAGENTA 95
#define LIGHT_CYAN 96
#define LIGHT_WHITE 97
// Default Foreground Color Definitions
#define FDEFAULT 49
#define FBLACK 40
#define FRED 41
#define FGREEN 42
#define FYELLOW 43
#define FBLUE 44
#define FMAGENTA 45
#define FCYAN 46
#define FLIGHT_GRAY 47
#define FDARK_GRAY 100
#define FLIGHT_RED 101
#define FLIGHT_GREEN 102
#define FLIGHT_YELLOW 103
#define FLIGHT_BLUE 104
#define FLIGHT_MAGENTA 105
#define FLIGHT_CYAN 106
#define FWHITE 107
#define DEFAULT 39
#define BLACK 30
#define RED 31
#define GREEN 32
#define YELLOW 33
#define BLUE 34
#define MAGENTA 35
#define CYAN 36
#define WHITE 37
#define LIGHT_BLACK 90
#define LIGHT_RED 91
#define LIGHT_GREEN 92
#define LIGHT_YELLOW 93
#define LIGHT_BLUE 94
#define LIGHT_MAGENTA 95
#define LIGHT_CYAN 96
#define LIGHT_WHITE 97
#define RED_COLOR() printf("\033[0;31m")
#define GREEN_COLOR() printf("\033[0;32m")
#define YELLOW_COLOR() printf("\033[0;33m")
#define BLUE_COLOR() printf("\033[0;34m")
#define MAGENTA_COLOR() printf("\033[0;35m")
#define CYAN_COLOR() printf("\033[0;36m")
#define LIGHT_BLACK_COLOR() printf("\033[0;90m")
#define LIGHT_RED_COLOR() printf("\033[0;91m")
#define LIGHT_GREEN_COLOR() printf("\033[0;92m")
#define LIGHT_YELLOW_COLOR() printf("\033[0;93m")
#define LIGHT_BLUE_COLOR() printf("\033[0;94m")
#define LIGHT_MAGENTA_COLOR() printf("\033[0;95m")
#define LIGHT_CYAN_COLOR() printf("\033[0;96m")
#define LIGHT_WHITE_COLOR() printf("\033[0;97m")
// Default bold** color definitions
#define BOLD_RED_COLOR() printf("\033[1;31m")
#define BOLD_GREEN_COLOR() printf("\033[1;32m")
#define BOLD_YELLOW_COLOR() printf("\033[01;33m")
#define BOLD_BLUE_COLOR() printf("\033[1;34m")
#define BOLD_MAGENTA_COLOR() printf("\033[1;35m")
#define BOLD_CYAN_COLOR() printf("\033[1;36m")
#define BOLD_LIGHT_BLACK_COLOR() printf("\033[1;90m")
#define BOLD_LIGHT_RED_COLOR() printf("\033[1;91m")
#define BOLD_LIGHT_GREEN_COLOR() printf("\033[1;92m")
#define BOLD_LIGHT_YELLOW_COLOR() printf("\033[1;93m")
#define BOLD_LIGHT_BLUE_COLOR() printf("\033[1;94m")
#define BOLD_LIGHT_MAGENTA_COLOR() printf("\033[1;95m")
#define BOLD_LIGHT_CYAN_COLOR() printf("\033[1;96m")
#define BOLD_LIGHT_WHITE_COLOR() printf("\033[1;97m")
#define RESETB() printf("\033[0m")
#define RESETW() printf("\033[1;37m")
// Default color definitions without printlnf
#define WRED_COLOR "\033[0;31m"
#define WGREEN_COLOR "\033[0;32m"
#define WYELLOW_COLOR "\033[0;33m"
#define WBLUE_COLOR "\033[0;34m"
#define WMAGENTA_COLOR "\033[0;35m"
#define WCYAN_COLOR "\033[0;36m"
#define WLIGHT_BLACK_COLOR "\033[0;90m"
#define WLIGHT_RED_COLOR "\033[0;91m"
#define WLIGHT_GREEN_COLOR "\033[0;92m"
#define WLIGHT_YELLOW_COLOR "\033[0;93m"
#define WLIGHT_BLUE_COLOR "\033[0;94m"
#define WLIGHT_MAGENTA_COLOR "\033[0;95m"
#define WLIGHT_CYAN_COLOR "\033[0;96m"
#define WLIGHT_WHITE_COLOR "\033[0;97m"
// Default bold** color definitions without printlnf
#define WBOLD_RED_COLOR "\033[1;31m"
#define WBOLD_GREEN_COLOR "\033[1;32m"
#define WBOLD_YELLOW_COLOR "\033[01;33m"
#define WBOLD_BLUE_COLOR "\033[1;34m"
#define WBOLD_MAGENTA_COLOR "\033[1;35m"
#define WBOLD_CYAN_COLOR "\033[1;36m"
#define WBOLD_LIGHT_BLACK_COLOR "\033[1;90m"
#define WBOLD_LIGHT_RED_COLOR "\033[1;91m"
#define WBOLD_LIGHT_GREEN_COLOR "\033[1;92m"
#define WBOLD_LIGHT_YELLOW_COLOR "\033[1;93m"
#define WBOLD_LIGHT_BLUE_COLOR "\033[1;94m"
#define WBOLD_LIGHT_MAGENTA_COLOR "\033[1;95m"
#define WBOLD_LIGHT_CYAN_COLOR "\033[1;96m"
#define WBOLD_LIGHT_WHITE_COLOR "\033[1;97m"
#define WBOLD_WHITE_COLOR "\033[1;37m"
// Sign
#define Semicolon ";"
#define Mark "m"
#define Template "\033["
static std::string Markstr(Mark);
static std::string Semicolonstr(Semicolon);
static std::string Templatestr(Template);
// Reset (BLACK)
#define WBLACK_COLOR "\033[0m"
#endif // COLORIZED_HPP