-
-
Save Celti/7921e87c4995b7a106debb9c5c2bf06c to your computer and use it in GitHub Desktop.
the worst hr script ever
This file contains 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
#!/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