Skip to content

Instantly share code, notes, and snippets.

@trevarj
Created March 13, 2023 08:28
Show Gist options
  • Save trevarj/8063034b23511ba690845d1231faabb4 to your computer and use it in GitHub Desktop.
Save trevarj/8063034b23511ba690845d1231faabb4 to your computer and use it in GitHub Desktop.
Script to show all terminal colors
#!/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