Guest User

Untitled

a guest
Jun 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. width=1000 truecolor-test
  2.  
  3. #!/bin/bash
  4. # Based on: https://gist.github.com/XVilka/8346728
  5.  
  6. awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
  7. s="/\";
  8. for (colnum = 0; colnum<term_cols; colnum++) {
  9. r = 255-(colnum*255/term_cols);
  10. g = (colnum*510/term_cols);
  11. b = (colnum*255/term_cols);
  12. if (g>255) g = 510-g;
  13. printf "33[48;2;%d;%d;%dm", r,g,b;
  14. printf "33[38;2;%d;%d;%dm", 255-r,255-g,255-b;
  15. printf "%s33[0m", substr(s,colnum%2+1,1);
  16. }
  17. printf "n";
  18. }'
Add Comment
Please, Sign In to add comment