Skip to content

Instantly share code, notes, and snippets.

@dezza
Created March 28, 2018 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dezza/2cd70123175576d2c49578e4a554ad2c to your computer and use it in GitHub Desktop.
Save dezza/2cd70123175576d2c49578e4a554ad2c to your computer and use it in GitHub Desktop.
Original colortest? Or better hehe.
#!/bin/bash
T='gYw' # The test text
echo "Background: 0 1 2 3 4 5 6 7"
echo "Foreground:"
for FG in 0 1 2 3 4 5 6 7
do
echo -en " ${FG} $(tput setaf ${FG}) $T "
for BG in 0 1 2 3 4 5 6 7
do
echo -en "$(tput setaf ${FG})$(tput setab ${BG}) $T ";
echo -en "$(tput sgr0) "
done
echo
# Do it again, in bold:
echo -en " ${FG}bold $(tput bold)$(tput setaf ${FG}) $T "
for BG in 0 1 2 3 4 5 6 7
do
echo -en "$(tput bold)$(tput setaf ${FG})$(tput setab ${BG}) $T ";
echo -en "$(tput sgr0) "
done
echo
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment