forked from gozfree/gear-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor.h
70 lines (67 loc) · 2.5 KB
/
color.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
/******************************************************************************
* Copyright (C) 2014-2017 Zhifeng Gong <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with libraries; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
******************************************************************************/
#ifndef _COLOR_H_
#define _COLOR_H_
#ifndef __WIN32__
#define FG_BLACK 30
#define FG_RED 31
#define FG_GREEN 32
#define FG_YELLOW 33
#define FG_BLUE 34
#define FG_MAGENTA 35
#define FG_CYAN 36
#define FG_WHITE 37
#define BG_BLACK 40
#define BG_RED 41
#define BG_GREEN 42
#define BG_YELLOW 43
#define BG_BLUE 44
#define BG_MAGENTA 45
#define BG_CYAN 46
#define BG_WHITE 47
#define B_RED(str) "\033[1;31m" str "\033[0m"
#define B_GREEN(str) "\033[1;32m" str "\033[0m"
#define B_YELLOW(str) "\033[1;33m" str "\033[0m"
#define B_BLUE(str) "\033[1;34m" str "\033[0m"
#define B_MAGENTA(str) "\033[1;35m" str "\033[0m"
#define B_CYAN(str) "\033[1;36m" str "\033[0m"
#define B_WHITE(str) "\033[1;37m" str "\033[0m"
#define RED(str) "\033[31m" str "\033[0m"
#define GREEN(str) "\033[32m" str "\033[0m"
#define YELLOW(str) "\033[33m" str "\033[0m"
#define BLUE(str) "\033[34m" str "\033[0m"
#define MAGENTA(str) "\033[35m" str "\033[0m"
#define CYAN(str) "\033[36m" str "\033[0m"
#define WHITE(str) "\033[37m" str "\033[0m"
#else
#define B_RED(str) str
#define B_GREEN(str) str
#define B_YELLOW(str) str
#define B_BLUE(str) str
#define B_MAGENTA(str) str
#define B_CYAN(str) str
#define B_WHITE(str) str
#define RED(str) str
#define GREEN(str) str
#define YELLOW(str) str
#define BLUE(str) str
#define MAGENTA(str) str
#define CYAN(str) str
#define WHITE(str) str
#endif
#endif