Created
May 23, 2011 20:57
-
-
Save yrosen/987588 to your computer and use it in GitHub Desktop.
Shows forground & background ANSI color codes
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 | |
# I'm not really sure where this is originally from... | |
# It prints out a (colored!) list of background & foreground colors | |
for attr in 0 1 4 5 7 ; do | |
printf "ESC[%s;Foreground;Background - \n" $attr | |
for fore in 30 31 32 33 34 35 36 37; do | |
for back in 40 41 42 43 44 45 46 47; do | |
printf '\033[%s;%s;%sm %02s;%02s ' $attr $fore $back $fore $back | |
done | |
printf '\n' | |
done | |
printf '\033[0m' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment