Skip to content

Instantly share code, notes, and snippets.

@whhone
Last active March 16, 2025 03:10
24-bit-true-color.sh
awk 'BEGIN{
n=256
for (colnum = 0; colnum<n; colnum++) {
r = 255-(colnum*255/n);
g = (colnum*510/n);
b = (colnum*255/n);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
printf "/\033[0m";
}
printf "\n";
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment