Some terminal color checker scripts:

  • Changing foreground:

    for c in {0..255} ; do tput setaf $c ; printf "%03d" "$c" ; tput sgr0 ; echo ; done | less -r
    
  • Changing background:

    for c in {0..255} ; do tput setab $c ; printf "%03d" "$c" ; tput sgr0 ; echo ; done | less -r