-
+ E62BABA43B453728B656000845E11CA673ED970E09CCC1271033DECBC9ACC02F309FD537B73CB5B063B76A7DF98517CAE28A47AEF8C588FBFF1D64BB6CBF1211
mp-wp/wp-includes/js/jquery/jquery.color.js
(0 . 0)(1 . 128)
101206 /*
101207 * jQuery Color Animations
101208 * Copyright 2007 John Resig
101209 * Released under the MIT and GPL licenses.
101210 */
101211
101212 (function(jQuery){
101213
101214 // We override the animation for all of these color styles
101215 jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
101216 jQuery.fx.step[attr] = function(fx){
101217 if ( fx.state == 0 ) {
101218 fx.start = getColor( fx.elem, attr );
101219 fx.end = getRGB( fx.end );
101220 }
101221
101222 fx.elem.style[attr] = "rgb(" + [
101223 Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
101224 Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
101225 Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
101226 ].join(",") + ")";
101227 }
101228 });
101229
101230 // Color Conversion functions from highlightFade
101231 // By Blair Mitchelmore
101232 // http://jquery.offput.ca/highlightFade/
101233
101234 // Parse strings looking for color tuples [255,255,255]
101235 function getRGB(color) {
101236 var result;
101237
101238 // Check if we're already dealing with an array of colors
101239 if ( color && color.constructor == Array && color.length == 3 )
101240 return color;
101241
101242 // Look for rgb(num,num,num)
101243 if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
101244 return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
101245
101246 // Look for rgb(num%,num%,num%)
101247 if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
101248 return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
101249
101250 // Look for #a0b1c2
101251 if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
101252 return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
101253
101254 // Look for #fff
101255 if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
101256 return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
101257
101258 // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
101259 if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
101260 return colors['transparent']
101261
101262 // Otherwise, we're most likely dealing with a named color
101263 return colors[jQuery.trim(color).toLowerCase()];
101264 }
101265
101266 function getColor(elem, attr) {
101267 var color;
101268
101269 do {
101270 color = jQuery.curCSS(elem, attr);
101271
101272 // Keep going until we find an element that has color, or we hit the body
101273 if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
101274 break;
101275
101276 attr = "backgroundColor";
101277 } while ( elem = elem.parentNode );
101278
101279 return getRGB(color);
101280 };
101281
101282 // Some named colors to work with
101283 // From Interface by Stefan Petre
101284 // http://interface.eyecon.ro/
101285
101286 var colors = {
101287 aqua:[0,255,255],
101288 azure:[240,255,255],
101289 beige:[245,245,220],
101290 black:[0,0,0],
101291 blue:[0,0,255],
101292 brown:[165,42,42],
101293 cyan:[0,255,255],
101294 darkblue:[0,0,139],
101295 darkcyan:[0,139,139],
101296 darkgrey:[169,169,169],
101297 darkgreen:[0,100,0],
101298 darkkhaki:[189,183,107],
101299 darkmagenta:[139,0,139],
101300 darkolivegreen:[85,107,47],
101301 darkorange:[255,140,0],
101302 darkorchid:[153,50,204],
101303 darkred:[139,0,0],
101304 darksalmon:[233,150,122],
101305 darkviolet:[148,0,211],
101306 fuchsia:[255,0,255],
101307 gold:[255,215,0],
101308 green:[0,128,0],
101309 indigo:[75,0,130],
101310 khaki:[240,230,140],
101311 lightblue:[173,216,230],
101312 lightcyan:[224,255,255],
101313 lightgreen:[144,238,144],
101314 lightgrey:[211,211,211],
101315 lightpink:[255,182,193],
101316 lightyellow:[255,255,224],
101317 lime:[0,255,0],
101318 magenta:[255,0,255],
101319 maroon:[128,0,0],
101320 navy:[0,0,128],
101321 olive:[128,128,0],
101322 orange:[255,165,0],
101323 pink:[255,192,203],
101324 purple:[128,0,128],
101325 violet:[128,0,128],
101326 red:[255,0,0],
101327 silver:[192,192,192],
101328 white:[255,255,255],
101329 yellow:[255,255,0],
101330 transparent: [255,255,255]
101331 };
101332
101333 })(jQuery);