{"size": 1325, "ext": "js", "max_stars_repo_path": "mysql-dst/mysql-cluster/storage/ndb/mcc/frontend/dojo/dojox/gfx/gradutils.js", "max_stars_repo_name": "SJTU-IPADS/dst", "max_stars_repo_stars_event_min_datetime": "2020-12-17T01:59:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T16:25:08.000Z", "max_issues_repo_path": "mysql-dst/mysql-cluster/ndb/mcc/frontend/dojo/dojox/gfx/gradutils.js", "max_issues_repo_name": "SJTU-IPADS/dst", "max_issues_repo_issues_event_min_datetime": "2021-07-30T12:06:33.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-31T10:16:09.000Z", "max_forks_repo_path": "mysql-dst/mysql-cluster/ndb/mcc/frontend/dojo/dojox/gfx/gradutils.js", "max_forks_repo_name": "SJTU-IPADS/dst", "max_forks_repo_forks_event_min_datetime": "2021-08-01T13:47:07.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-01T13:47:07.000Z"}
{"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 20.703125, "max_line_length": 238, "alphanum_fraction": 0.6520754717}
//>>built
define("dojox/gfx/gradutils",["./_base","dojo/_base/lang","./matrix","dojo/_base/Color"],function(g,_1,m,_2){
var _3=g.gradutils={};
function _4(o,c){
if(o<=0){
return c[0].color;
}
var _5=c.length;
if(o>=1){
return c[_5-1].color;
}
for(var i=0;i<_5;++i){
var _6=c[i];
if(_6.offset>=o){
if(i){
var _7=c[i-1];
return _2.blendColors(new _2(_7.color),new _2(_6.color),(o-_7.offset)/(_6.offset-_7.offset));
}
return _6.color;
}
}
return c[_5-1].color;
};
_3.getColor=function(_8,pt){
var o;
if(_8){
switch(_8.type){
case "linear":
var _9=Math.atan2(_8.y2-_8.y1,_8.x2-_8.x1),_a=m.rotate(-_9),_b=m.project(_8.x2-_8.x1,_8.y2-_8.y1),p=m.multiplyPoint(_b,pt),_c=m.multiplyPoint(_b,_8.x1,_8.y1),_d=m.multiplyPoint(_b,_8.x2,_8.y2),_e=m.multiplyPoint(_a,_d.x-_c.x,_d.y-_c.y).x;
o=m.multiplyPoint(_a,p.x-_c.x,p.y-_c.y).x/_e;
break;
case "radial":
var dx=pt.x-_8.cx,dy=pt.y-_8.cy;
o=Math.sqrt(dx*dx+dy*dy)/_8.r;
break;
}
return _4(o,_8.colors);
}
return new _2(_8||[0,0,0,0]);
};
_3.reverse=function(_f){
if(_f){
switch(_f.type){
case "linear":
case "radial":
_f=_1.delegate(_f);
if(_f.colors){
var c=_f.colors,l=c.length,i=0,_10,n=_f.colors=new Array(c.length);
for(;i<l;++i){
_10=c[i];
n[i]={offset:1-_10.offset,color:_10.color};
}
n.sort(function(a,b){
return a.offset-b.offset;
});
}
break;
}
}
return _f;
};
return _3;
});
 