-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolors.txt
35 lines (30 loc) · 1.62 KB
/
colors.txt
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
Exhaustive colors info: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
\\e === ESC
Sequence: \\e[\e[36;1m<codes separated by ';'>\e[0mm
Reset all: \\e[0m
0 reset
1 \e[1mbold\e[0m
22 normal text; no longer bold or faint, keeps current color
4 \e[4munderline\e[0m
FG BG regular bright
30 40 \e[30;47mBlack\e[0m \e[30;1;47mBlack\e[0m
31 41 \e[31mRed\e[0m \e[31;1mRed\e[0m
32 42 \e[32mGreen\e[0m \e[32;1mGreen\e[0m
33 43 \e[33mYellow\e[0m \e[33;1mYellow\e[0m
34 44 \e[34mBlue\e[0m \e[34;1mBlue\e[0m
35 45 \e[35mMagenta\e[0m \e[35;1mMagenta\e[0m
36 46 \e[36mCyan\e[0m \e[36;1mCyan\e[0m
37 47 \e[37;40mWhite\e[0m \e[37;1;40mWhite\e[0m
Example: $ echo -e "\\e[1;35;42m Bold magenta on green background \\e[0m"
Becomes: \e[1;35;42m Bold magenta on green background \e[0m
Apparently non-standard but widely supported, these are brighter background colors:
\e[30;100m100\e[0m\e[30;101m101\e[0m\e[30;102m102\e[0m\e[30;103m103\e[0m\e[30;104m104\e[0m\e[30;105m105\e[0m\e[30;106m106\e[0m\e[30;107m107\e[0m
216 colors:
\\e[38;5;\e[36;1mn\e[0mm where \e[36;1mn\e[0m comes from a color table: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
\\e[48;5;\e[36;1mn\e[0mm for background
Orange: \e[38;5;208m\\e[38;5;208m\e[0m
Millions of colors:
\\e[38;2;\e[36;1mr\e[0m;\e[36;1mg\e[0m;\e[36;1mb\e[0mm integer \e[36;1mrgb\e[0m values, foreground color
\\e[48;2;\e[36;1mr\e[0m;\e[36;1mg\e[0m;\e[36;1mb\e[0mm integer \e[36;1mrgb\e[0m values, background color
Surround the escape sequences (start and end separately) with \[ ... \] to prevent their length from being counted in
the prompt string length.