Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created February 7, 2020 06:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RichardBronosky/b8eb9836eef7b7ecd58d8446c90d2649 to your computer and use it in GitHub Desktop.
Save RichardBronosky/b8eb9836eef7b7ecd58d8446c90d2649 to your computer and use it in GitHub Desktop.
#!/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
@RichardBronosky
Copy link
Author

Screen Shot 2020-02-07 at 1 25 08 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment