Created
May 28, 2019 15:07
-
-
Save pablopunk/90ac8384528cc9c7497566bbd8660a7c to your computer and use it in GitHub Desktop.
Test true colors on terminal
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
# from https://twitter.com/josh_cheek/status/1116321447234940928 | |
ruby -eh,w=$LINES,$COLUMNS' | |
B=(0..20).map{[0,rand*h,rand*5,rand]} | |
loop{B. map!{|x,y,v,a|[(x+v),y+a=y<0?-a:a-0.1,v,a]} | |
$><<"\e[H"<<h.times. map{|v|w.times. map{|u|d=B. map{|x,y|Math.sqrt (w/2-(x+w/2-u)%w)**2/4+(v-y)**2}.min*9 | |
"\e[48;2;#{d<0?0:d>255?255:d. to_i};0;0m "}*""}*"\n"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment