#!/bin/sh
color="0"
interval="0"

# Print ``standard'' 16 terminal colors
while test "$color" != "16"; do
	echo -n -e "\033[48;5;${color}m "
	if test "${interval}" = "7"; then
		interval="-1"
		echo -e "\033[0m"
	fi
	color=`echo "${color} + 1" | bc`
	interval=`echo "${interval} + 1" | bc`
done

echo
interval="0"

# Print the rest of the 256 colors
while test "$color" != "256"; do
	echo -n -e "\033[48;5;${color}m "
	if test "${interval}" = "5"; then
		interval="-1"
		echo -e "\033[0m"
	fi
	color=`echo "${color} + 1" | bc`
	interval=`echo "${interval} + 1" | bc`
done

echo
#color="16"
#
# Print the rest of the 256 colors
#while test "$color" != "21"; do
#        interval="0"
#
#        while test "$interval" != "13"; do
#                seq=`echo "${color} + 18 * $interval" | bc`
#                echo -n -e "\033[48;5;${seq}m "
#
		seq=`echo "${color} + 6 + 18 * $interval" | bc`
		echo -n -e "\033[38;5;${seq}m#"
#
#                interval=`echo "${interval} + 1" | bc`
#        done
#        color=`echo "${color} + 1" | bc`
#        echo -e "\033[0m"
#done
#
#echo

