#!/bin/sh
#
# colordump - dump 256 ansi colors to the terminal.

printf "How each ANSI color is displayed on your terminal:\n\n"

i=0
row=0
# while [ "${i}" -lt 255 ]; do
for i in $(seq 0 255); do
  newrow=$((i / 10))
  test "${newrow}" -ne "${row}" && printf "\n"
  row=${newrow}
  printf "\e[%dm %03d \e[0m" "${i}" "${i}"
  i=$((i + 1))
done

printf '\n\n     e.g., "\\e[41mTEXT\\e[0m" '
printf "\e[41m(for TEXT like this)\e[0m\n"
