Skip to content

Commit cafa196

Browse files
committed
Set up Mac colors
1 parent 76708bb commit cafa196

File tree

1 file changed

+40
-24
lines changed

1 file changed

+40
-24
lines changed

etc/bash/colors

+40-24
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1-
## Normal colors
1+
## Loads colors into variables based on platform
22

3-
black='\e[0;30m'
4-
red='\e[0;31m'
5-
green='\e[0;32m'
6-
yellow='\e[0;33m'
7-
blue='\e[0;34m'
8-
magenta='\e[0;35m'
9-
cyan='\e[0;36m'
10-
white='\e[0;37m'
11-
12-
## Bold colors
13-
14-
blackBold='\e[1;30m'
15-
redBold='\e[1;31m'
16-
greenBold='\e[1;32m'
17-
yellowBold='\e[1;33m'
18-
blueBold='\e[1;34m'
19-
magentaBold='\e[1;35m'
20-
cyanBold='\e[1;36m'
21-
whiteBold='\e[1;37m'
22-
23-
## No color
24-
25-
NC='\e[0m'
3+
if [[ "$(uname)" == "Darwin" ]] ; then
4+
black='\033[0;30m'
5+
red='\033[0;31m'
6+
green='\033[0;32m'
7+
yellow='\033[0;33m'
8+
blue='\033[0;34m'
9+
magenta='\033[0;35m'
10+
cyan='\033[0;36m'
11+
white='\033[0;37m'
12+
blackBold='\033[1;30m'
13+
redBold='\033[1;31m'
14+
greenBold='\033[1;32m'
15+
yellowBold='\033[1;33m'
16+
blueBold='\033[1;34m'
17+
magentaBold='\033[1;35m'
18+
cyanBold='\033[1;36m'
19+
whiteBold='\033[1;37m'
20+
## No color
21+
NC='\033[0m'
22+
else
23+
black='\e[0;30m'
24+
red='\e[0;31m'
25+
green='\e[0;32m'
26+
yellow='\e[0;33m'
27+
blue='\e[0;34m'
28+
magenta='\e[0;35m'
29+
cyan='\e[0;36m'
30+
white='\e[0;37m'
31+
blackBold='\e[1;30m'
32+
redBold='\e[1;31m'
33+
greenBold='\e[1;32m'
34+
yellowBold='\e[1;33m'
35+
blueBold='\e[1;34m'
36+
magentaBold='\e[1;35m'
37+
cyanBold='\e[1;36m'
38+
whiteBold='\e[1;37m'
39+
## No color
40+
NC='\e[0m'
41+
fi

0 commit comments

Comments
 (0)