#!/bin/bash

printc() {
    printf '\e[48;5;%dm    %s\e[0m' "$1" "$2"
}

for i in {0..1}; do
    for _ in {0..1}; do
        for ((j=8*i;j<8*(i+1);++j)); do
            printc "$j" "   "
        done
        echo
    done
done

echo

for i in {0..5}; do
    for _ in {0..1}; do
        for ((j=36*i+16;j<36*(i+1)+16;++j)); do
            printc "$j"
            [ $(((j + -15) % 6)) -eq 0 ] && printf " " || printf ""
        done
        echo
    done
done

echo

for _ in {0..1}; do
    for i in {232..255}; do
        printc "$i" "  "
    done
    echo
done
