/* Build-0.5: color.core.js color.rgb.js color.huebased.js color.hsv.js color.hsl.js color.object.js color.parse.js color.related.js color.palette.css3.js */
/*
 * jQuery Colour 0.5
 *
 * Copyright (c) 2009 Adaptavist.com
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Author: Mark Gibson (jollytoad at gmail dot com)
 *
 * http://www.adaptavist.com/display/jQuery/Colour+Library
 */
(jQuery.color||(function(a){a.color={isEqual:function(b,d){if(b.length!==d.length){return false}var c=b.length;while(c--){if(b[c]!==d[c]){return false}}return true},fix:function(b,d){var c=d.length;while(c--){if(typeof b[c]==="number"){switch(d.charAt(c)){case"i":b[c]=Math.round(b[c]);break;case"o":b[c]=Math.min(255,Math.max(0,Math.round(b[c])));break;case"1":b[c]=Math.min(1,Math.max(0,b[c]));break}}}return b},self:function(b){return b},alpha:function(b){return b===undefined?1:b},palette:{},fns:[]}})(jQuery));(jQuery.color&&(function(a){a.color.RGB={fix:function(b){b=a.color.fix(b,"ooo1");return b},toRGB:a.color.self,toHEX:function(b){return"#"+(16777216+b[0]*65536+b[1]*256+b[2]).toString(16).slice(-6)},toCSS:function(b){if(a.color.alpha(b[3])===0){return"transparent"}if(a.color.alpha(b[3])<1){return"rgba("+b.join(",")+")"}return"rgb("+Array.prototype.slice.call(b,0,3).join(",")+")"},red:function(b){return b[0]},green:function(b){return b[1]},blue:function(b){return b[2]},alpha:function(b){return a.color.alpha(b[3])}};a.color.RGB.toString=a.color.RGB.toHEX;a.color.fns.push("RGB.toRGB","RGB.toHEX","RGB.toCSS","RGB.red","RGB.green","RGB.blue","RGB.alpha")})(jQuery));(jQuery.color&&(function(a){a.color.HueBased={fix:function(b){b[0]=(b[0]+1)%1;return a.color.fix(b,"1111")},complementary:function(c,b){return[(c[0]+0.5+(b||0))%1,c[1],c[2],c[3]]},analogous:function(c,b){return[(c[0]+1+(b||0))%1,c[1],c[2],c[3]]},hue:function(b){return b[0]},alpha:function(b){return a.color.alpha(b[3])}}})(jQuery));(jQuery.color&&(function(a){a.color.HSV=a.extend({toHSV:a.color.self,toRGB:function(d){var h=d[0]*6,e=Math.floor(h),g=h-e,l=d[1],j=d[2]*255,i=d[3],c=Math.round(j*(1-l)),b=Math.round(j*(1-g*l)),k=Math.round(j*(1-(1-g)*l));j=Math.round(j);switch(e%6){case 0:return[j,k,c,i];case 1:return[b,j,c,i];case 2:return[c,j,k,i];case 3:return[c,b,j,i];case 4:return[k,c,j,i];case 5:return[j,c,b,i]}},saturationV:function(b){return b[1]},value:function(b){return b[2]}},a.color.HueBased);a.color.RGB.toHSV=function(f){var j=f[0]/255,i=f[1]/255,e=f[2]/255,h=Math.min(j,i,e),c=Math.max(j,i,e),k=c-h;return[k===0?0:(i===c?(e-j)/k/6+(1/3):e===c?(j-i)/k/6+(2/3):(i-e)/k/6+1)%1,k===0?0:k/c,c,f[3]]};a.color.fns.push("HSV.toHSV","HSV.toRGB","RGB.toHSV","HSV.complementary","HSV.analogous","HSV.hue","HSV.saturationV","HSV.value","HSV.alpha")})(jQuery));(jQuery.color&&(function(a){a.color.HSL=a.extend({toHSL:a.color.self,toRGB:function(d){var f=d[0],e=d[1],b=d[2],g=b<0.5?b*(1+e):b+e-(b*e),i=2*b-g;function j(c){var h=c<0?c+1:c>1?c-1:c;return h<1/6?i+(g-i)*6*h:h<1/2?g:h<2/3?i+(g-i)*6*(2/3-h):i}return[Math.round(255*j(f+1/3)),Math.round(255*j(f)),Math.round(255*j(f-1/3)),d[3]]},saturationL:function(b){return b[1]},lightness:function(b){return b[2]}},a.color.HueBased);a.color.RGB.toHSL=function(f){var j=f[0]/255,i=f[1]/255,e=f[2]/255,h=Math.min(j,i,e),c=Math.max(j,i,e),l=c-h,k=c+h;return[l===0?0:(i===c?(e-j)/l/6+(1/3):e===c?(j-i)/l/6+(2/3):(i-e)/l/6+1)%1,l===0?0:k>1?l/(2-c-h):l/k,k/2,f[3]]};a.color.fns.push("HSL.toHSL","HSL.toRGB","RGB.toHSL","HSL.complementary","HSL.analogous","HSL.hue","HSL.saturationL","HSL.lightness","HSL.alpha")})(jQuery));(jQuery.color&&jQuery.Color||(function(a){a.Color=function(e,h,f){if(typeof this==="function"){return new a.Color(e,h,f)}if(typeof e==="string"&&a.color.parse){if(!f){f=e}e=a.color.parse(e)}if(e&&e.length){var g;g=this.length=e.length;while(g--){this[g]=e[g]}}if(e){this.space=h||e.space||"RGB";this.name=f||e.name}};a.Color.fn=a.Color.prototype={color:"0.5",util:function(){return a.color[this.space]},to:function(e){return this["to"+e]()},fix:function(){return this.util().fix(this)},modify:function(e){var f=a.Color.isInstance(e)&&e.space!==this.space?this.to(e.space):new a.Color(this),h=f.length,g=false;while(h--){if(typeof e[h]==="number"&&e[h]!==f[h]){f[h]=e[h];g=true}}return g?f.setName():this},setName:function(e){this.name=e;return this},toString:function(){if(!this.space){return""}var e=this.util();return e.hasOwnProperty("toString")?e.toString(this):this.to("RGB").toString()},join:[].join,push:[].push};a.Color.isInstance=function(e){return e&&typeof e==="object"&&e.color===a.Color.fn.color&&e.space};a.Color.fnspace={};function d(f,g,h,i,e){return function(){var k=[f];Array.prototype.push.apply(k,arguments);var j=h.apply(g,k);return a.isArray(j)?new a.Color(j,i,e?f.name:undefined):j}}function c(f,g){var e=/^to/.test(g)?g.substring(2):false;return function(){var j=this,i=j.util();if(!i[g]){j=j.to(a.Color.fnspace[g]);i=j.util()}var k=d(j,i,i[g],e||j.space,!!e),h=k.apply(j,arguments);if(e){this[g]=function(){return h};if(a.Color.isInstance(h)){j=this;h["to"+this.space]=function(){return j}}}else{this[g]=k}return h}}function b(){var f=this.split("."),e=f[1],g=f[0];if(!a.Color.fnspace[e]&&e!=="to"+g){a.Color.fnspace[e]=g}if(!a.Color.fn[e]){a.Color.fn[e]=c(this,e)}}a.each(a.color.fns,b);a.color.fns.push=function(){a.each(arguments,b);return Array.prototype.push.apply(this,arguments)}})(jQuery));(jQuery.color&&(function(a){a.extend(a.color,{parse:function(c){var b;if(typeof c==="string"){if((b=/^\s*rgb(a)?\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(c))&&!b[1]===!b[5]){return[parseInt(b[2],10),parseInt(b[3],10),parseInt(b[4],10),b[5]?parseFloat(b[5]):1]}if((b=/^\s*rgb(a)?\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(c))&&!b[1]===!b[5]){return[parseFloat(b[2])*255/100,parseFloat(b[3])*255/100,parseFloat(b[4])*255/100,b[5]?parseFloat(b[5]):1]}if((b=/^\s*#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})\s*$/.exec(c))){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),1]}if((b=/^\s*#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])\s*$/.exec(c))){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16),1]}if((b=/^\s*hsl(a)?\(\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*(?:,\s*([0-9]+(?:\.[0-9]+)?)\s*)?\)\s*$/.exec(c))&&!b[1]===!b[5]){return[parseInt(b[2],10)/360,parseFloat(b[3])/100,parseFloat(b[4])/100,b[5]?parseFloat(b[5]):1]}return a.color.named(c)}if(c&&(c.length===3||c.length===4)){if(c.length===3){c.push(1)}return c}},named:function(c){var b;c=a.trim(c.toLowerCase());if(c==="transparent"){return[0,0,0,0]}a.each(a.color.palette,function(e,d){if(d[c]){b=d[c];return false}});return b}})})(jQuery));(jQuery.Color&&(function(a){a.Color.fn.related=function(d){var b=a.Color.fn.related.i18n,c=d||a.Color.fn.related.offset,e=Math.round(c*360)+b.deg;return{"anal-":this.analogous(-c).setName(b.anal+" -"+e),anal0:this.analogous().setName(b.orig),"anal+":this.analogous(c).setName(b.anal+" +"+e),"comp-":this.complementary(-c).setName(b.split+" -"+e),comp0:this.complementary().setName(b.comp),"comp+":this.complementary(c).setName(b.split+" +"+e),"triad-":this.analogous(-1/3).setName(b.triad+" -120"+b.deg),triad0:this.analogous().setName(b.orig),"triad+":this.analogous(1/3).setName(b.triad+" +120"+b.deg)}};a.Color.fn.related.offset=30/360;a.Color.fn.related.i18n={deg:"¡",anal:"Analogous",orig:"Original",split:"Split Complementary",comp:"Complementary",triad:"Triadic"}})(jQuery));(jQuery.color&&(function(a){a.color.palette.css3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})(jQuery));