Skip to content

Instantly share code, notes, and snippets.

View j1ng3r's full-sized avatar
🍄
I'm verbing

Marcus Luebke j1ng3r

🍄
I'm verbing
View GitHub Profile
function Point(x,y){
if(this==window)return new Point(x,y);
if(typeof x=='object')
this.set(x[0]||x.x,x[1]||x.y);
else if(typeof x=='number')
this.set(+x,+y);
this.set(this.x||0,this.y||0);
}
Point.prototype.add=function(a,b){
a=Point(a,b);
function Color(...a){
while(a.length&&typeof a[a.length-1]=='undefined')a.pop();
this.r=0;
this.g=0;
this.b=0;
this.a=0;
if(a.length){
if(typeof a[0]=='string'){
a=a[0].toLowerCase();
if(a[0]=='#')switch((a=a.substr(1)).length){