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
|
#!/bin/bash
sed '
s@\x1b\[0m@ ${color}@g
'"$(
while read -r code color; do
printf 's@\\x1b\\[\\(0;\\)\\?%sm@ ${color %s}@g\n' \
"${code}" \
"${color}"
done \
<"${0%/*}/colors"
)"
exit
RTEXT = '\x1b[7m' # reverse
NTEXT = '\x1b[0m' # normal
BTEXT = '\x1b[1m' # bold
RESET = '\33[0m'
'black': NamedColor(index=0, light=False),
'dark red': NamedColor(index=1, light=False),
'dark green': NamedColor(index=2, light=False),
'brown': NamedColor(index=3, light=False),
'dark blue': NamedColor(index=4, light=False),
'dark magenta': NamedColor(index=5, light=False),
'dark cyan': NamedColor(index=6, light=False),
'white': NamedColor(index=7, light=False),
'dark gray': NamedColor(index=0, light=True), # actually light black
'light red': NamedColor(index=1, light=True),
'light green': NamedColor(index=2, light=True),
'yellow': NamedColor(index=3, light=True),
'light blue': NamedColor(index=4, light=True),
'light magenta': NamedColor(index=5, light=True),
'light cyan': NamedColor(index=6, light=True)
'light gray': NamedColor(index=7, light=True),
|