src/pyams_skin/resources/js/ext/jquery-color-2.1.2.min.js
changeset 557 bca7a7e058a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/jquery-color-2.1.2.min.js	Thu Feb 13 11:43:31 2020 +0100
@@ -0,0 +1,1 @@
+!function(r,n){function t(r,n,t){var e=f[n.type]||{};return null==r?t||!n.def?null:n.def:(r=e.floor?~~r:parseFloat(r),isNaN(r)?n.def:e.mod?(r+e.mod)%e.mod:0>r?0:e.max<r?e.max:r)}function e(n){var t=u(),e=t._rgba=[];return n=n.toLowerCase(),d(s,function(r,o){var a,i=o.re.exec(n),s=i&&o.parse(i),u=o.space||"rgba";if(s)return a=t[u](s),t[l[u].cache]=a[l[u].cache],e=t._rgba=a._rgba,!1}),e.length?("0,0,0,0"===e.join()&&r.extend(e,a.transparent),t):a[n]}function o(r,n,t){return 6*(t=(t+1)%1)<1?r+(n-r)*t*6:2*t<1?n:3*t<2?r+(n-r)*(2/3-t)*6:r}var a,i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[r[1],r[2],r[3],r[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[2.55*r[1],2.55*r[2],2.55*r[3],r[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(r){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(r){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(r){return[r[1],r[2]/100,r[3]/100,r[4]]}}],u=r.Color=function(n,t,e,o){return new r.Color.fn.parse(n,t,e,o)},l={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},f={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=u.support={},p=r("<p>")[0],d=r.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,d(l,function(r,n){n.cache="_"+r,n.props.alpha={idx:3,type:"percent",def:1}}),u.fn=r.extend(u.prototype,{parse:function(n,o,i,s){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=r(n).css(o),o=void 0);var f=this,c=r.type(n),p=this._rgba=[];return void 0!==o&&(n=[n,o,i,s],c="array"),"string"===c?this.parse(e(n)||a._default):"array"===c?(d(l.rgba.props,function(r,e){p[e.idx]=t(n[e.idx],e)}),this):"object"===c?(n instanceof u?d(l,function(r,t){n[t.cache]&&(f[t.cache]=n[t.cache].slice())}):d(l,function(e,o){var a=o.cache;d(o.props,function(r,e){if(!f[a]&&o.to){if("alpha"===r||null==n[r])return;f[a]=o.to(f._rgba)}f[a][e.idx]=t(n[r],e,!0)}),f[a]&&r.inArray(null,f[a].slice(0,3))<0&&(f[a][3]=1,o.from&&(f._rgba=o.from(f[a])))}),this):void 0},is:function(r){var n=u(r),t=!0,e=this;return d(l,function(r,o){var a,i=n[o.cache];return i&&(a=e[o.cache]||o.to&&o.to(e._rgba)||[],d(o.props,function(r,n){if(null!=i[n.idx])return t=i[n.idx]===a[n.idx]})),t}),t},_space:function(){var r=[],n=this;return d(l,function(t,e){n[e.cache]&&r.push(t)}),r.pop()},transition:function(r,n){var e=u(r),o=e._space(),a=l[o],i=0===this.alpha()?u("transparent"):this,s=i[a.cache]||a.to(i._rgba),c=s.slice();return e=e[a.cache],d(a.props,function(r,o){var a=o.idx,i=s[a],u=e[a],l=f[o.type]||{};null!==u&&(null===i?c[a]=u:(l.mod&&(u-i>l.mod/2?i+=l.mod:i-u>l.mod/2&&(i-=l.mod)),c[a]=t((u-i)*n+i,o)))}),this[o](c)},blend:function(n){if(1===this._rgba[3])return this;var t=this._rgba.slice(),e=t.pop(),o=u(n)._rgba;return u(r.map(t,function(r,n){return(1-e)*o[n]+e*r}))},toRgbaString:function(){var n="rgba(",t=r.map(this._rgba,function(r,n){return null==r?n>2?1:0:r});return 1===t[3]&&(t.pop(),n="rgb("),n+t.join()+")"},toHslaString:function(){var n="hsla(",t=r.map(this.hsla(),function(r,n){return null==r&&(r=n>2?1:0),n&&n<3&&(r=Math.round(100*r)+"%"),r});return 1===t[3]&&(t.pop(),n="hsl("),n+t.join()+")"},toHexString:function(n){var t=this._rgba.slice(),e=t.pop();return n&&t.push(~~(255*e)),"#"+r.map(t,function(r){return 1===(r=(r||0).toString(16)).length?"0"+r:r}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),u.fn.parse.prototype=u.fn,l.hsla.to=function(r){if(null==r[0]||null==r[1]||null==r[2])return[null,null,null,r[3]];var n,t,e=r[0]/255,o=r[1]/255,a=r[2]/255,i=r[3],s=Math.max(e,o,a),u=Math.min(e,o,a),l=s-u,f=s+u,c=.5*f;return n=u===s?0:e===s?60*(o-a)/l+360:o===s?60*(a-e)/l+120:60*(e-o)/l+240,t=0===l?0:c<=.5?l/f:l/(2-f),[Math.round(n)%360,t,c,null==i?1:i]},l.hsla.from=function(r){if(null==r[0]||null==r[1]||null==r[2])return[null,null,null,r[3]];var n=r[0]/360,t=r[1],e=r[2],a=r[3],i=e<=.5?e*(1+t):e+t-e*t,s=2*e-i;return[Math.round(255*o(s,i,n+1/3)),Math.round(255*o(s,i,n)),Math.round(255*o(s,i,n-1/3)),a]},d(l,function(n,e){var o=e.props,a=e.cache,s=e.to,l=e.from;u.fn[n]=function(n){if(s&&!this[a]&&(this[a]=s(this._rgba)),void 0===n)return this[a].slice();var e,i=r.type(n),f="array"===i||"object"===i?n:arguments,c=this[a].slice();return d(o,function(r,n){var e=f["object"===i?r:n.idx];null==e&&(e=c[n.idx]),c[n.idx]=t(e,n)}),l?(e=u(l(c)),e[a]=c,e):u(c)},d(o,function(t,e){u.fn[t]||(u.fn[t]=function(o){var a,s=r.type(o),u="alpha"===t?this._hsla?"hsla":"rgba":n,l=this[u](),f=l[e.idx];return"undefined"===s?f:("function"===s&&(o=o.call(this,f),s=r.type(o)),null==o&&e.empty?this:("string"===s&&(a=i.exec(o))&&(o=f+parseFloat(a[2])*("+"===a[1]?1:-1)),l[e.idx]=o,this[u](l)))})})}),u.hook=function(n){var t=n.split(" ");d(t,function(n,t){r.cssHooks[t]={set:function(n,o){var a,i,s="";if("transparent"!==o&&("string"!==r.type(o)||(a=e(o)))){if(o=u(a||o),!c.rgba&&1!==o._rgba[3]){for(i="backgroundColor"===t?n.parentNode:n;(""===s||"transparent"===s)&&i&&i.style;)try{s=r.css(i,"backgroundColor"),i=i.parentNode}catch(r){}o=o.blend(s&&"transparent"!==s?s:"_default")}o=o.toRgbaString()}try{n.style[t]=o}catch(r){}}},r.fx.step[t]=function(n){n.colorInit||(n.start=u(n.elem,t),n.end=u(n.end),n.colorInit=!0),r.cssHooks[t].set(n.elem,n.start.transition(n.end,n.pos))}})},u.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),r.cssHooks.borderColor={expand:function(r){var n={};return d(["Top","Right","Bottom","Left"],function(t,e){n["border"+e+"Color"]=r}),n}},a=r.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery);