Last active
November 7, 2022 07:30
-
-
Save eliranmal/b373abbe1c21e991b394bdffb0c8a6cf to your computer and use it in GitHub Desktop.
spits N ansi colors to the terminal
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 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