Last active
March 16, 2025 03:10
-
-
Save whhone/6852e485e8ccf51fd3631ba29ab7fad2 to your computer and use it in GitHub Desktop.
24-bit-true-color.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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