Created
March 13, 2023 08:28
-
-
Save trevarj/8063034b23511ba690845d1231faabb4 to your computer and use it in GitHub Desktop.
Script to show all terminal 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 | |
DEFAULT_COLORS=256 | |
COLORS="${1:-DEFAULT_COLORS}" | |
for ((n = 0; n < $COLORS; n++)); do | |
if ((n < 10)); then s=" "; elif ((n < 100)); then s=" "; else s=" "; fi | |
printf " %s[%d] $(tput setaf $n)%s$(tput sgr0)" "$s" $n "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | |
" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment