YUI.add("color-base",function(c,r){var o=/^#?([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})(\ufffe)?/,e=/^#?([\da-fA-F]{1})([\da-fA-F]{1})([\da-fA-F]{1})(\ufffe)?/,t=/rgba?\(([\d]{1,3}), ?([\d]{1,3}), ?([\d]{1,3}),? ?([.\d]*)?\)/;c.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},REGEX_HEX:o,REGEX_HEX3:e,REGEX_RGB:t,re_RGB:t,re_hex:o,re_hex3:e,STR_HEX:"#{*}{*}{*}",STR_RGB:"rgb({*}, {*}, {*})",STR_RGBA:"rgba({*}, {*}, {*}, {*})",TYPES:{HEX:"hex",RGB:"rgb",RGBA:"rgba"},CONVERTS:{hex:"toHex",rgb:"toRGB",rgba:"toRGBA"},convert:function(r,o){var o=c.Color.CONVERTS[o.toLowerCase()],e=r;return e=o&&c.Color[o]?c.Color[o](r):e},toHex:function(r){var r=c.Color._convertTo(r,"hex"),o="transparent"===r.toLowerCase();return"#"===r.charAt(0)||o||(r="#"+r),o?r.toLowerCase():r.toUpperCase()},toRGB:function(r){return c.Color._convertTo(r,"rgb").toLowerCase()},toRGBA:function(r){return c.Color._convertTo(r,"rgba").toLowerCase()},toArray:function(r){var o,e,t=c.Color.findType(r).toUpperCase();return"A"===(t="HEX"===t&&r.length<5?"HEX3":t).charAt(t.length-1)&&(t=t.slice(0,-1)),!(o=c.Color["REGEX_"+t])||!(r=(e=o.exec(r)||[]).length)||(e.shift(),r--,"HEX3"===t&&(e[0]+=e[0],e[1]+=e[1],e[2]+=e[2]),e[r-1])||(e[r-1]=1),e},fromArray:function(r,o){if(r=r.concat(),void 0===o)return r.join(", ");for(o=c.Color["STR_"+o.toUpperCase()],3===r.length&&4===o.match(/\{\*\}/g).length&&r.push(1);0<=o.indexOf("{*}")&&0<r.length;)o=o.replace("{*}",r.shift());return o},findType:function(r){var o,e;return c.Color.KEYWORDS[r]?"keyword":(e=0<(o=r.indexOf("("))?r.substr(0,o):e)&&c.Color.TYPES[e.toUpperCase()]?c.Color.TYPES[e.toUpperCase()]:"hex"},_getAlpha:function(r){var o,r=c.Color.toArray(r);return+(o=3<r.length?r.pop():o)||1},_keywordToHex:function(r){r=c.Color.KEYWORDS[r];if(r)return r},_convertTo:function(r,o){var e,t,a,n,f,l;return"transparent"!==r&&(t=o,"keyword"===(e=c.Color.findType(r))&&(r=c.Color._keywordToHex(r),e="hex"),"hex"===e&&r.length<5&&(r="#"+(r="#"===r.charAt(0)?r.substr(1):r).charAt(0)+r.charAt(0)+r.charAt(1)+r.charAt(1)+r.charAt(2)+r.charAt(2)),e!==o&&("a"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),(a="a"===o.charAt(o.length-1))&&(o=o.slice(0,-1),n=c.Color._getAlpha(r)),l=o.charAt(0).toUpperCase()+o.substr(1).toLowerCase(),(f=c.Color["_"+e+"To"+l])||"rgb"!==e&&"rgb"!==o&&(r=c.Color["_"+e+"ToRgb"](r),f=c.Color["_"+(e="rgb")+"To"+l]),f&&(r=f(r,a)),a))&&((r=c.Lang.isArray(r)?r:c.Color.toArray(r)).push(n),r=c.Color.fromArray(r,t.toUpperCase())),r},_hexToRgb:function(r,o){var e,t;return"#"===r.charAt(0)&&(r=r.substr(1)),e=(r=parseInt(r,16))>>16,t=r>>8&255,r=255&r,o?[e,t,r]:"rgb("+e+", "+t+", "+r+")"},_rgbToHex:function(r){for(var r=c.Color.toArray(r),o=(+(o=r[2]|r[1]<<8|r[0]<<16)).toString(16);o.length<6;)o="0"+o;return"#"+o}}},"patched-v3.18.7",{requires:["yui-base"]});