-
-
Save sebastien/d1f1012a107d7a41cbfe528bd823114e to your computer and use it in GitHub Desktop.
spits N ansi colors to the terminal
This file contains hidden or 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 sh | |
usage() { | |
echo "show-ansi-colors <n>" | |
exit 0 | |
} | |
(( $# < 1 )) && usage | |
show_ansi_colors() { | |
local colors=$1 | |
echo "showing $colors ansi colors:" | |
for (( n=0; n < $colors; n++ )) do | |
printf " [%d] $(tput setaf $n)%s$(tput sgr0)" $n "wMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMwMw | |
" | |
done | |
echo | |
} | |
show_ansi_colors "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment