Skip to content

Instantly share code, notes, and snippets.

@catc
Created October 4, 2020 23:33
Show Gist options
  • Save catc/9776e8adf0ebd9ab491f4a89f24e0db3 to your computer and use it in GitHub Desktop.
Save catc/9776e8adf0ebd9ab491f4a89f24e0db3 to your computer and use it in GitHub Desktop.
display 8 bit ansi colors in terminal
for i in {0..255} ; do
printf "\x1b[38;5;%sm%5d\e[0m " "$i" "$i"
if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
printf "\n";
fi
done
for i in {0..255} ; do
printf "\e[1m\x1b[38;5;%sm%10d\e[0m " "$i" "$i"
if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
printf "\n";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment