Created
February 7, 2020 06:28
-
-
Save RichardBronosky/b8eb9836eef7b7ecd58d8446c90d2649 to your computer and use it in GitHub Desktop.
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 | |
tput init | |
end=$(( $(tput colors)-1 )) | |
w=8 | |
for c in $(seq 0 $end); do | |
tput setaf $c | |
[[ $c -ge $(( w*2 )) ]] && offset=2 || offset=0 | |
[[ $(((c+offset) % (w-offset))) -eq $(((w-offset)-1)) ]] && s=$'\n'|| s=' ' | |
printf "tput setaf %3s%s" "$c" "$s" | |
done | |
tput init |
Author
RichardBronosky
commented
Feb 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment