Skip to content

Instantly share code, notes, and snippets.

@wenLiangcan
Forked from jamesliu96/colors.sh
Created April 2, 2014 04:24
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 wenLiangcan/9927898 to your computer and use it in GitHub Desktop.
Save wenLiangcan/9927898 to your computer and use it in GitHub Desktop.
#!/bin/sh
# use `printf "\033[{{STYLE}};{{FOREGROUND_COLOR}};{{BACKGROUND_COLOR}}m"` to set the color of all the output from the shell
# use `printf "\033[0m"` to reset
for attr in 0 1 4 5 7 ; do
echo "----------------------------------------------------------------"
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
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment