Created
March 26, 2016 14:14
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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