root / trunk / web / dojo / dojox / charting / themes / gradientGenerator.js
History | View | Annotate | Download (1.24 KB)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.charting.themes.gradientGenerator"]){ |
9 |
dojo._hasResource["dojox.charting.themes.gradientGenerator"]=true; |
10 |
dojo.provide("dojox.charting.themes.gradientGenerator");
|
11 |
dojo.require("dojox.charting.Theme");
|
12 |
(function(){
|
13 |
var gg=dojox.charting.themes.gradientGenerator;
|
14 |
gg.generateFills=function(_1,_2,_3,_4){ |
15 |
var _5=dojox.charting.Theme;
|
16 |
return dojo.map(_1,function(c){ |
17 |
return _5.generateHslGradient(c,_2,_3,_4);
|
18 |
}); |
19 |
}; |
20 |
gg.updateFills=function(_6,_7,_8,_9){ |
21 |
var _a=dojox.charting.Theme;
|
22 |
dojo.forEach(_6,function(t){
|
23 |
if(t.fill&&!t.fill.type){
|
24 |
t.fill=_a.generateHslGradient(t.fill,_7,_8,_9); |
25 |
} |
26 |
}); |
27 |
}; |
28 |
gg.generateMiniTheme=function(_b,_c,_d,_e,_f){ |
29 |
var _10=dojox.charting.Theme;
|
30 |
return dojo.map(_b,function(c){ |
31 |
c=new dojox.color.Color(c);
|
32 |
return {fill:_10.generateHslGradient(c,_c,_d,_e),stroke:{color:_10.generateHslColor(c,_f)}}; |
33 |
}); |
34 |
}; |
35 |
gg.generateGradientByIntensity=function(_11,_12){ |
36 |
_11=new dojo.Color(_11);
|
37 |
return dojo.map(_12,function(_13){ |
38 |
var s=_13.i/255; |
39 |
return {offset:_13.o,color:new dojo.Color([_11.r*s,_11.g*s,_11.b*s,_11.a])}; |
40 |
}); |
41 |
}; |
42 |
})(); |
43 |
} |