Skip to content

Instantly share code, notes, and snippets.

@yrosen
Created May 23, 2011 20:57
Show Gist options
  • Save yrosen/987588 to your computer and use it in GitHub Desktop.
Save yrosen/987588 to your computer and use it in GitHub Desktop.
Shows forground & background ANSI color codes
#!/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