Created
September 6, 2017 08:05
-
-
Save zhoulifu/fce16dbe86d6903dd88cf39964a1ac7f to your computer and use it in GitHub Desktop.
Bash colors
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/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