LocalCDN-Firefox-Chrome-Brave/resources/gsap/1.20.5/PixiPlugin.min.jsm

12 lines
8.2 KiB
JavaScript
Raw Normal View History

2020-11-09 19:43:39 +01:00
/*!
* VERSION: 0.2.1
* DATE: 2018-02-15
* UPDATES AND DOCS AT: http://greensock.com
*
* @license Copyright (c) 2008-2018, GreenSock. All rights reserved.
* PixiPlugin is subject to the terms at http://greensock.com/standard-license or for
* Club GreenSock members, the software agreement that was issued with your membership.
*
* @author: Jack Doyle, jack@greensock.com
*/
var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var a,b,c,d=/(\d|\.)+/g,e=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,f={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},g=function(a,b,c){return a=0>a?a+1:a>1?a-1:a,255*(1>6*a?b+(c-b)*a*6:.5>a?c:2>3*a?b+(c-b)*(2/3-a)*6:b)+.5|0},h=function(a,b){var c,h,i,j,k,l,m,n,o,p,q,r="hsl"===b;if(a)if("number"==typeof a)c=[a>>16,a>>8&255,255&a];else{if(","===a.charAt(a.length-1)&&(a=a.substr(0,a.length-1)),f[a])c=f[a];else if("#"===a.charAt(0))4===a.length&&(h=a.charAt(1),i=a.charAt(2),j=a.charAt(3),a="#"+h+h+i+i+j+j),a=parseInt(a.substr(1),16),c=[a>>16,a>>8&255,255&a];else if("hsl"===a.substr(0,3))if(c=q=a.match(d),r){if(-1!==a.indexOf("="))return a.match(e)}else k=Number(c[0])%360/360,l=Number(c[1])/100,m=Number(c[2])/100,i=.5>=m?m*(l+1):m+l-m*l,h=2*m-i,c.length>3&&(c[3]=Number(a[3])),c[0]=g(k+1/3,h,i),c[1]=g(k,h,i),c[2]=g(k-1/3,h,i);else c=a.match(d)||f.transparent;c[0]=Number(c[0]),c[1]=Number(c[1]),c[2]=Number(c[2]),c.length>3&&(c[3]=Number(c[3]))}else c=f.black;return r&&!q&&(h=c[0]/255,i=c[1]/255,j=c[2]/255,n=Math.max(h,i,j),o=Math.min(h,i,j),m=(n+o)/2,n===o?k=l=0:(p=n-o,l=m>.5?p/(2-n-o):p/(n+o),k=n===h?(i-j)/p+(j>i?6:0):n===i?(j-h)/p+2:(h-i)/p+4,k*=60),c[0]=k+.5|0,c[1]=100*l+.5|0,c[2]=100*m+.5|0),"number"===b?c[0]<<16|c[1]<<8|c[2]:c},i=function(a,b){var c,d,e,f=(a+"").match(k)||[],g=0,i="";if(!f.length)return a;for(c=0;c<f.length;c++)d=f[c],e=a.substr(g,a.indexOf(d,g)-g),g+=e.length+d.length,d=h(d,b?"hsl":"rgb"),3===d.length&&d.push(1),i+=e+(b?"hsla("+d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:"rgba("+d.join(","))+")";return i+a.substr(g)},j=(_gsScope.GreenSockGlobals||_gsScope).TweenLite,k="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b",l=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],m=.212671,n=.71516,o=.072169,p=function(a,b){var c,d,e=[],f=0,g=0;for(c=0;4>c;c++){for(d=0;5>d;d++)g=4===d?a[f+4]:0,e[f+d]=a[f]*b[d]+a[f+1]*b[d+5]+a[f+2]*b[d+10]+a[f+3]*b[d+15]+g;f+=5}return e},q=function(a,b){var c=1-b,d=c*m,e=c*n,f=c*o;return p([d+b,e,f,0,0,d,e+b,f,0,0,d,e,f+b,0,0,0,0,0,1,0],a)},r=function(a,b,c){var d=h(b),e=d[0]/255,f=d[1]/255,g=d[2]/255,i=1-c;return p([i+c*e*m,c*e*n,c*e*o,0,0,c*f*m,i+c*f*n,c*f*o,0,0,c*g*m,c*g*n,i+c*g*o,0,0,0,0,0,1,0],a)},s=function(a,b){b*=Math.PI/180;var c=Math.cos(b),d=Math.sin(b);return p([m+c*(1-m)+d*-m,n+c*-n+d*-n,o+c*-o+d*(1-o),0,0,m+c*-m+.143*d,n+c*(1-n)+.14*d,o+c*-o+d*-.283,0,0,m+c*-m+d*-(1-m),n+c*-n+d*n,o+c*(1-o)+d*o,0,0,0,0,0,1,0,0,0,0,0,1],a)},t=function(a,b){return p([b,0,0,0,.5*(1-b),0,b,0,0,.5*(1-b),0,0,b,0,.5*(1-b),0,0,0,1,0],a)},u=function(a,b){var c,d=_gsScope.PIXI.filters[b],e=a.filters||[],f=e.length;if(!d)throw"PixiPlugin error: "+b+" isn't present.";for(;--f>-1;)if(e[f]instanceof d)return e[f];return c=new d,"BlurFilter"===b&&(c.blur=0),e.push(c),a.filters=e,c},v=function(a,b,c,d){b._addTween(c,a,c[a],d[a],a),b._overwriteProps.push(a)},w=function(a,b){var c=new _gsScope.PIXI.filters.ColorMatrixFilter;return c.matrix=b,c.brightness(a,!0),c.matrix},x={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},y=function(a,b,c){var d,e,f,g=u(a,"ColorMatrixFilter"),h=a._gsColorMatrixFilter=a._gsColorMatrixFilter||{contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},i=b.combineCMF&&!("colorMatrixFilter"in b&&!b.colorMatrixFilter);f=g.matrix,b.resolution&&(g.resolution=b.resolution),b.matrix&&b.matrix.length===f.length?(e=b.matrix,1!==h.contrast&&v("contrast",c,h,x),h.hue&&v("hue",c,h,x),1!==h.brightness&&v("brightness",c,h,x),h.colorizeAmount&&(v("colorize",c,h,x),v("colorizeAmount",c,h,x)),1!==h.saturation&&v("saturation",