#!/bin/bash

{
	for c in {0..15}; do
		printf "\e[48;5;${c}m %03d" $c
	done
	echo; echo

	for r in {0..5}; do
		for g in {0..5}; do
			for b in {0..5}; do
				printf "\e[48;5;$((16+r*36+g*6+b))m %03d" $((16+r*36+g*6+b))
			done
			echo
		done
		echo #-ne "\e[6A\e[24Chello"
	done
	echo

	#for l in {0..6}; do echo; done
	for c in {232..243}; do
		printf "\e[48;5;${c}m %03d" $c
	done
	echo

	for c in {244..255}; do
		printf "\e[48;5;${c}m %03d" $c
	done
	echo; echo

	for c in 0 16 232 233 234 235 236 237 238 239 8 240 59 241 242 243 244; do
		printf "\e[48;5;${c}m %03d" $c
	done
	echo

	for c in 102 245 246 247 248 7 145 249 250 251 252 188 253 254 255 15 231; do
		printf "\e[48;5;${c}m %03d" $c
	done
} | less -R
