//>>built
define("dojox/color/_base",["../main","dojo/_base/lang","dojo/_base/Color","dojo/colors"],function(h,i,j,l){h=i.getObject("color",!0,h);h.Color=j;h.blend=j.blendColors;h.fromRgb=j.fromRgb;h.fromHex=j.fromHex;h.fromArray=j.fromArray;h.fromString=j.fromString;h.greyscale=l.makeGrey;i.mixin(h,{fromCmy:function(a,c,b){if(i.isArray(a))c=a[1],b=a[2],a=a[0];else if(i.isObject(a))c=a.m,b=a.y,a=a.c;a/=100;c/=100;b/=100;c=1-c;b=1-b;return new j({r:Math.round(255*(1-a)),g:Math.round(255*c),b:Math.round(255*
b)})},fromCmyk:function(a,c,b,d){if(i.isArray(a))c=a[1],b=a[2],d=a[3],a=a[0];else if(i.isObject(a))c=a.m,b=a.y,d=a.b,a=a.c;a/=100;c/=100;b/=100;d/=100;a=1-Math.min(1,a*(1-d)+d);c=1-Math.min(1,c*(1-d)+d);b=1-Math.min(1,b*(1-d)+d);return new j({r:Math.round(255*a),g:Math.round(255*c),b:Math.round(255*b)})},fromHsl:function(a,c,b){if(i.isArray(a))c=a[1],b=a[2],a=a[0];else if(i.isObject(a))c=a.s,b=a.l,a=a.h;c/=100;for(b/=100;0>a;)a+=360;for(;360<=a;)a-=360;var d,e,f;120>a?(d=(120-a)/60,e=a/60,f=0):240>
a?(d=0,e=(240-a)/60,f=(a-120)/60):(d=(a-240)/60,e=0,f=(360-a)/60);d=2*c*Math.min(d,1)+(1-c);e=2*c*Math.min(e,1)+(1-c);f=2*c*Math.min(f,1)+(1-c);0.5>b?(d*=b,e*=b,f*=b):(d=(1-b)*d+2*b-1,e=(1-b)*e+2*b-1,f=(1-b)*f+2*b-1);return new j({r:Math.round(255*d),g:Math.round(255*e),b:Math.round(255*f)})}});h.fromHsv=function(a,c,b){if(i.isArray(a))c=a[1],b=a[2],a=a[0];else if(i.isObject(a))c=a.s,b=a.v,a=a.h;360==a&&(a=0);var c=c/100,b=b/100,d,e,f;if(0==c)d=b,f=b,e=b;else{var g=a/60,a=Math.floor(g),h=g-a,g=b*
(1-c),k=b*(1-c*h),c=b*(1-c*(1-h));switch(a){case 0:d=b;e=c;f=g;break;case 1:d=k;e=b;f=g;break;case 2:d=g;e=b;f=c;break;case 3:d=g;e=k;f=b;break;case 4:d=c;e=g;f=b;break;case 5:d=b,e=g,f=k}}return new j({r:Math.round(255*d),g:Math.round(255*e),b:Math.round(255*f)})};i.extend(j,{toCmy:function(){var a=1-this.g/255,c=1-this.b/255;return{c:Math.round(100*(1-this.r/255)),m:Math.round(100*a),y:Math.round(100*c)}},toCmyk:function(){var a,c,b,d=this.r/255;c=this.g/255;b=this.b/255;a=Math.min(1-d,1-c,1-b);
c=(1-c-a)/(1-a);b=(1-b-a)/(1-a);return{c:Math.round(100*((1-d-a)/(1-a))),m:Math.round(100*c),y:Math.round(100*b),b:Math.round(100*a)}},toHsl:function(){var a=this.r/255,c=this.g/255,b=this.b/255,d=Math.min(a,b,c),e=Math.max(a,c,b),f=e-d,g=0,h=0,d=(d+e)/2;0<d&&1>d&&(h=f/(0.5>d?2*d:2-2*d));0<f&&(e==a&&e!=c&&(g+=(c-b)/f),e==c&&e!=b&&(g+=2+(b-a)/f),e==b&&e!=a&&(g+=4+(a-c)/f),g*=60);return{h:g,s:Math.round(100*h),l:Math.round(100*d)}},toHsv:function(){var a=this.r/255,c=this.g/255,b=this.b/255,d=Math.min(a,
b,c),e=Math.max(a,c,b),d=e-d,f=null,g=0==e?0:d/e;0==g?f=0:(f=a==e?60*(c-b)/d:c==e?120+60*(b-a)/d:240+60*(a-c)/d,0>f&&(f+=360));return{h:f,s:Math.round(100*g),v:Math.round(100*e)}}});return h});