aboutsummaryrefslogtreecommitdiffstats
path: root/tests/colors.sh
blob: c48673e305967566c5826ba77bf0d8c9acfd0f3e (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh

# cursor to 0,0
printf '\033[H'
printf '\033[0m(256) System colors: background\n'
for COLOR in $(seq 0 7); do
   printf '\033[48;5;%sm  ' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 8 15); do
   printf '\033[48;5;%sm  ' "${COLOR}"
done
printf '\033[0m\n';

printf '\033[0m System colors: background\n'
for COLOR in $(seq 40 47); do
   printf '\033[%sm  ' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 100 107); do
   printf '\033[%sm  ' "${COLOR}"
done
printf '\033[0m\n';


printf '\033[0m System colors: foreground\n'
for COLOR in $(seq 30 37); do
   printf '\033[0;%sm██' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 90 97); do
   printf '\033[0;%sm██' "${COLOR}"
done
printf '\033[0m\n';

printf '\n\n\n\nColor cube, 6x6x6:\n';
for GREEN in $(seq 0 5); do
   for RED in $(seq 0 5); do
      for BLUE in $(seq 0 5); do
         COLOR=$((16 + (RED * 36) + (GREEN * 6) + BLUE))
         printf '\033[48;5;%sm  ' "${COLOR}"
      done
      printf '\033[0m '
   done
   printf '\n'
done

#printf '\033[0m\n';
printf 'Grayscale ramp:\n';
for COLOR in $(seq 232 255); do
    printf '\033[48;5;%sm  ' "${COLOR}"
done
printf '\x1b[0m\n';

# restrict cursor
printf '\033[?6h'
# allow left/right margins
printf '\033[?69h'
# set left/right margins:
printf '\033[40s'


printf '\033[0m Bright colors: background\n'
for COLOR in $(seq 40 47); do
   printf '\033[1;%sm  ' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 100 107); do
   printf '\033[1;%sm  ' "${COLOR}"
done
printf '\033[0m\n';


printf '\033[0m Bright colors: foreground\n'
for COLOR in $(seq 30 37); do
   printf '\033[1;%sm██' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 90 97); do
   printf '\033[1;%sm██' "${COLOR}"
done
printf '\033[0m\n';


printf '\033[0m Dim/Faint colors: background\n'
for COLOR in $(seq 40 47); do
   printf '\033[2;%sm  ' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 100 107); do
   printf '\033[2;%sm  ' "${COLOR}"
done
printf '\033[0m\n';


printf '\033[0m Dim/Faint colors: foreground\n'
for COLOR in $(seq 30 37); do
   printf '\033[2;%sm██' "${COLOR}"
done
printf '\033[0m\n';
for COLOR in $(seq 90 97); do
   printf '\033[2;%sm██' "${COLOR}"
done
printf '\033[0m\n';