Skip to content

Instantly share code, notes, and snippets.

@Celti
Last active August 31, 2021 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Celti/7921e87c4995b7a106debb9c5c2bf06c to your computer and use it in GitHub Desktop.
Save Celti/7921e87c4995b7a106debb9c5c2bf06c to your computer and use it in GitHub Desktop.
the worst hr script ever
#!/bin/awk -f
BEGIN {
"tput cols" | getline cols;
length(ARGV[1]) == 0 ? s = "▄" : s = ARGV[1];
for (colnum = 0; colnum<cols; colnum++) {
r = 255-(colnum*255/cols);
g = (colnum*510/cols);
b = (colnum*255/cols);
if (g>255) g = 510-g;
printf "\033[48;2;%d;%d;%dm", r,g,b;
printf "\033[38;2;%d;%d;%dm", xor(r,255),xor(g,255),xor(b,255);
printf "%s\033[0m", s;
}
printf "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment