Last active
November 21, 2019 23:38
-
-
Save michaelsanford/8561202 to your computer and use it in GitHub Desktop.
Bash colour code quick reference
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
#!/usr/bin/env bash | |
#### | |
# Invoke with | |
# $ bash_colours [limit] | |
### | |
if hash tput >/dev/null 2>&1; then | |
bound=${1:-255} | |
for (( i = 0; i < bound; i++ )); do | |
echo -n "$(tput setaf $i)[$i]$(tput sgr0)" | |
done | |
else | |
echo "Requires tput" | |
exit 1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment