2021-10-22 09:27:21 -07:00
|
|
|
#!/usr/bin/env bash
|
2024-07-22 06:54:25 -07:00
|
|
|
# compat: +ash +bash +dash +hush +ksh +mksh +oksh +osh +posh +yash +zsh
|
2021-10-22 09:27:21 -07:00
|
|
|
|
|
|
|
colors2() {
|
|
|
|
[ $# -eq 0 ] || { printf "%s\n" "$0: does not take arguments" >&2; return 1; }
|
2022-03-06 13:12:17 -08:00
|
|
|
local a= b= i= j=
|
2021-10-22 09:27:21 -07:00
|
|
|
for a in 0 60; do
|
2021-11-03 07:48:37 -07:00
|
|
|
for j in 40 41 43 42 46 44 45 47; do
|
|
|
|
printf ' \033[%s;%sm %03d \033[m' '48;5;16' $((a+j-10)) $((a+j))
|
|
|
|
done
|
|
|
|
printf '\n'
|
|
|
|
|
2021-10-22 09:27:21 -07:00
|
|
|
for b in 0 60; do
|
|
|
|
for i in 30 31 33 32 36 34 35 37; do
|
|
|
|
for j in 40 41 43 42 46 44 45 47; do
|
2021-11-03 07:48:37 -07:00
|
|
|
printf ' \033[%s;%sm %03d \033[m' $((a+j)) $((b+i)) $((b+i))
|
2021-10-22 09:27:21 -07:00
|
|
|
done
|
|
|
|
printf '\n'
|
|
|
|
done
|
|
|
|
done
|
|
|
|
[ $a = 0 ] && printf '\n'
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -n "${preload+-}" ] || colors2 "$@"
|