forked from mevdschee/2048.c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
palette.sh
41 lines (41 loc) · 1.03 KB
/
palette.sh
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
#!/bin/sh
echo "[8 colors] => ^[[4#m"
for color in {0..7} ; do
#Display the color
number=$(printf " %-5d " "$color")
echo -en "\033[4${color}m${number}\033[0m"
#Display 8 colors per line
if [ $((($color + 1) % 8)) == 0 ] ; then
echo #New line
fi
done
echo "[16 colors] => ^[[48;5;#m"
for color in {0..15} ; do
#Display the color
number=$(printf " %-5d " "$color")
echo -en "\033[48;5;${color}m${number}\033[0m"
#Display 8 colors per line
if [ $((($color + 1) % 8)) == 0 ] ; then
echo #New line
fi
done
echo "[216 colors] => ^[[48;5;#m"
for color in {16..231} ; do
#Display the color
number=$(printf " %-7d " "$color")
echo -en "\033[48;5;${color}m${number}\033[0m"
#Display 6 colors per line
if [ $((($color - 15) % 6)) == 0 ] ; then
echo #New line
fi
done
echo "[24 shades of gray] => ^[[48;5;#m"
for color in {232..255} ; do
#Display the color
number=$(printf " %-3d " "$color")
echo -en "\033[48;5;${color}m${number}\033[0m"
#Display 12 colors per line
if [ $((($color - 231) % 12)) == 0 ] ; then
echo #New line
fi
done