-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashcolors.sh
More file actions
executable file
·75 lines (66 loc) · 1.29 KB
/
bashcolors.sh
File metadata and controls
executable file
·75 lines (66 loc) · 1.29 KB
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
#!/bin/bash
# Bash Color References
#Formatting:
Bold="\e[1m"
Dim="\e[2m"
Underlined="\e[4m"
Blink="\e[5m"
Inverted="\e[7m"
Hidden="\e[8m"
#Reset:
Normal="\e[0m"
ResetBoldOrBright="\e[21m"
ResetDim="\e[22m"
ResetUnderlined="\e[24m"
ResetBlink="\e[25m"
ResetReverse="\e[27m"
ResetHidden="\e[28m"
#Foreground:
Default="\e[39m"
Black="\e[30m"
Red="\e[31m"
Green="\e[32m"
Yellow="\e[33m"
Blue="\e[34m"
Magenta="\e[35m"
Cyan="\e[36m"
LightGrey="\e[37m"
DarkGrey="\e[90m"
LightRed="\e[91m"
LightGreen="\e[92m"
LightYellow="\e[93m"
LightBlue="\e[94m"
LightMagenta="\e[95m"
LightCyan="\e[96m"
White="\e[97m"
#Background
DefaultBg="\e[49m"
BlackBg="\e[40m"
RedBg="\e[41m"
GreenBg="\e[42m"
YellowBg="\e[43m"
BlueBg="\e[44m"
MagentaBg="\e[45m"
CyanBg="\e[46m"
LightGreyBg="\e[47m"
DarkGreyBg="\e[100m"
LightRedBg="\e[101m"
LightGreenBg="\e[102m"
LightYellowBg="\e[103m"
LightBlueBg="\e[104m"
LightMagentaBg="\e[105m"
LightCyanBg="\e[106m"
WhiteBg="\e[107m"
#Test 256 Color:
for fgbg in 38 48 ; do # Foreground / Background
for color in {0..255} ; do # Colors
# Display the color
printf "\e[${fgbg};5;%sm %3s \e[0m" $color $color
# Display 6 colors per lines
if [ $((($color + 1) % 6)) == 4 ] ; then
echo # New line
fi
done
echo # New line
done
exit 0