-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolors.sh
More file actions
47 lines (44 loc) · 1021 Bytes
/
colors.sh
File metadata and controls
47 lines (44 loc) · 1021 Bytes
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
#!/usr/bin/env bash
# See: https://en.wikipedia.org/wiki/ANSI_escape_code
if [[ ! $COLOR_RED ]]; then
COLOR_RED=$(tput setaf 1)
fi
if [[ ! $COLOR_GREEN ]]; then
COLOR_GREEN=$(tput setaf 2)
fi
if [[ ! $COLOR_YELLOW ]]; then
COLOR_YELLOW=$(tput setaf 3)
fi
if [[ ! $COLOR_BLUE ]]; then
COLOR_BLUE=$(tput setaf 12)
fi
if [[ ! $COLOR_GRAY ]]; then
COLOR_GRAY=$(tput setaf 240)
fi
if [[ ! $COLOR_LIGHT_GRAY ]]; then
COLOR_LIGHT_GRAY=$(tput setaf 250)
fi
if [[ ! $COLOR_DEFUALT ]]; then
COLOR_DEFUALT=$(tput sgr0)
fi
if [[ ! $BG_COLOR_RED ]]; then
BG_COLOR_RED=$(tput setab 1)
fi
if [[ ! $BG_COLOR_GREEN ]]; then
BG_COLOR_GREEN=$(tput setab 2)
fi
if [[ ! $BG_COLOR_YELLOW ]]; then
BG_COLOR_YELLOW=$(tput setab 3)
fi
if [[ ! $BG_COLOR_BLUE ]]; then
BG_COLOR_BLUE=$(tput setab 12)
fi
if [[ ! $BG_COLOR_GRAY ]]; then
BG_COLOR_GRAY=$(tput setab 240)
fi
if [[ ! $BG_COLOR_LIGHT_GRAY ]]; then
BG_COLOR_LIGHT_GRAY=$(tput setab 250)
fi
if [[ ! $BG_COLOR_DEFUALT ]]; then
BG_COLOR_DEFUALT=$(tput sgr0)
fi