2 # This file was originally taken from iterm2 https://github.com/gnachman/iTerm2/blob/master/tests/24-bit-color.sh
4 # This file echoes a bunch of 24-bit color codes
5 # to the terminal to demonstrate its functionality.
6 # The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
7 # The background escape sequence is ^[48;2;<r>;<g>;<b>m
8 # <r> <g> <b> range from 0 to 255 inclusive.
9 # The escape sequence ^[0m returns output to default
13 #printf '\x1bPtmux;\x1b\x1b[48;2;%s;%s;%sm' $1 $2 $3
14 printf '\x1b[48;2;%s;%s;%sm' $1 $2 $3
22 # Gives a color $1/255 % along HSV
23 # Who knows what happens when $1 is outside 0-255
24 # Echoes "$red $green $blue" where
25 # $red $green and $blue are integers
26 # ranging between 0 and 255 inclusive
53 # execution should never reach here
58 for i
in `seq 0 127`; do
59 setBackgroundColor
$i 0 0
63 for i
in `seq 255 -1 128`; do
64 setBackgroundColor
$i 0 0
69 for i
in `seq 0 127`; do
70 setBackgroundColor
0 $i 0
74 for i
in `seq 255 -1 128`; do
75 setBackgroundColor
0 $i 0
80 for i
in `seq 0 127`; do
81 setBackgroundColor
0 0 $i
85 for i
in `seq 255 -1 128`; do
86 setBackgroundColor
0 0 $i
91 for i
in `seq 0 127`; do
92 setBackgroundColor
`rainbowColor $i`
96 for i
in `seq 255 -1 128`; do
97 setBackgroundColor
`rainbowColor $i`