Skip to content

Instantly share code, notes, and snippets.

@derpixler
Created March 26, 2016 14:14
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 derpixler/c538d841f16ba2b3f121 to your computer and use it in GitHub Desktop.
Save derpixler/c538d841f16ba2b3f121 to your computer and use it in GitHub Desktop.
The code below is a sample of echo in colour, it will run through all the sequences and ouput some nice looking tables. This can be use to test what different colours will look like as well as show the hidious combinations.
#/bin/sh
# Show all the colours of the rainbow, should be run under bash
for STYLE in 0 1 2 3 4 5 6 7; do
for FG in 30 31 32 33 34 35 36 37; do
for BG in 40 41 42 43 44 45 46 47; do
CTRL="\033[${STYLE};${FG};${BG}m"
echo -en "${CTRL}"
echo -n "${STYLE};${FG};${BG}"
echo -en "\033[0m"
done
echo
done
echo
done
# Reset
echo -e "\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment