]> git.rmz.io Git - dotfiles.git/blob - bin/colortest256
tmux: remove terminal-overrides for true color
[dotfiles.git] / bin / colortest256
1 #!/bin/bash
2 # https://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
3 # https://gist.github.com/XVilka/8346728#gistcomment-3528771
4
5 T='::' # The test text
6
7 function echo_block() {
8 local fs=$1
9 local bs=$2
10 echo " 01234567"
11 for (( f = 0; f < 8; f++ )); do
12 echo -en " ${f} "
13 for (( b = 0; b < 8; b++ )); do
14 echo -en "\033[38;5;$((fs+f))m\033[48;5;$((bs+b))m$T\033[0m";
15 done
16 echo
17 done
18 }
19
20 function print_colors() {
21 local c
22 for (( c = $1; c < $1 + $2; c++)); do
23 echo -en "\033[48;5;${c}m$T\033[0m"
24 done
25 echo
26 }
27 function colors() {
28 print_colors 0 8
29 print_colors 8 8
30 for (( c = 16; c < 256 - 24; c += 36 )); do
31 print_colors $c 36
32 done
33 print_colors $((256 - 24)) 24
34 }
35
36 function true_colors() {
Reading blob failed.