Skip to content

Instantly share code, notes, and snippets.

@joaofnds
Created May 6, 2019 16:55
Show Gist options
  • Select an option

  • Save joaofnds/84894b9b196a3f23c0a38defc3669767 to your computer and use it in GitHub Desktop.

Select an option

Save joaofnds/84894b9b196a3f23c0a38defc3669767 to your computer and use it in GitHub Desktop.
show all terminal colors
echo -en "\n + "
for i in {0..35}; do
printf "%2b " $i
done
printf "\n\n %3b " 0
for i in {0..15}; do
echo -en "\033[48;5;${i}m \033[m "
done
#for i in 16 52 88 124 160 196 232; do
for i in {0..6}; do
let "i = i*36 +16"
printf "\n\n %3b " $i
for j in {0..35}; do
let "val = i+j"
echo -en "\033[48;5;${val}m \033[m "
done
done
echo -e "\n"
for fgbg in 38 48 ; do # Foreground / Background
for color in {0..255} ; do # Colors
# Display the color
printf "\e[${fgbg};5;%sm %3s \e[0m" $color $color
# Display 6 colors per lines
if [ $((($color + 1) % 6)) == 4 ] ; then
echo # New line
fi
done
echo # New line
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment