Last active
March 23, 2018 17:30
-
-
Save jorgehatccrma/ee8e245b6f5e41d625c4b0e14d0c34c0 to your computer and use it in GitHub Desktop.
Small bash script to print terminal color codes with bash
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
cumwidth=7 | |
for i in {0..255}; do | |
printf "\x1b[38;5;${i}m [%03i] \x1b[0m" $i ; | |
if [ $i -eq $cumwidth ]; then | |
echo ; | |
if [ $cumwidth -ge 15 ]; then | |
((cumwidth+=6)) | |
else | |
((cumwidth+=8)) | |
fi ; | |
fi ; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On a dark (black) background it should look like this: