Stack/js/vibrant.min.js

1 line
58 KiB
JavaScript
Raw Normal View History

2024-07-09 11:02:55 +08:00
!function(r){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=r,o.c=n,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=185)}([function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){var n=r(43),r="object"==typeof self&&self&&self.Object===Object&&self,r=n||r||Function("return this")();t.exports=r},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){var n=r(96),o=r(99);t.exports=function(t,e){return e=o(t,e),n(e)?e:void 0}},function(t,e,r){var n=r(42),o=r(81),i=r(10);t.exports=function(t){return(i(t)?n:o)(t)}},function(t,e,r){var n=r(7),o=r(77),i=r(78),u=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(u&&u in Object(t)?o:i)(t)}},function(t,e,r){r=r(1).Symbol;t.exports=r},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,n,e){"use strict";function r(t){t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return null===t?null:[t[1],t[2],t[3]].map(function(t){return parseInt(t,16)})}function o(t,e,r){return e/=255,r/=255,t=.04045<(t/=255)?Math.pow((t+.005)/1.055,2.4):t/12.92,e=.04045<e?Math.pow((e+.005)/1.055,2.4):e/12.92,r=.04045<r?Math.pow((r+.005)/1.055,2.4):r/12.92,[.4124*(t*=100)+.3576*(e*=100)+.1805*(r*=100),.2126*t+.7152*e+.0722*r,.0193*t+.1192*e+.9505*r]}function i(t,e,r){return e/=100,r/=108.883,t=.008856<(t/=95.047)?Math.pow(t,1/3):7.787*t+16/116,[116*(e=.008856<e?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(r=.008856<r?Math.pow(r,1/3):7.787*r+16/116))]}function u(t,e,r){r=o(t,e,r);return i(r[0],r[1],r[2])}function a(t,e){var r=t[0],n=t[1],o=t[2],i=e[0],u=e[1],a=e[2],s=r-i,t=n-u,e=o-a,o=Math.sqrt(n*n+o*o),r=i-r,a=Math.sqrt(u*u+a*a)-o,e=Math.sqrt(s*s+t*t+e*e),e=Math.sqrt(e)>Math.sqrt(Math.abs(r))+Math.sqrt(Math.abs(a))?Math.sqrt(e*e-r*r-a*a):0;return r/=1,a/=1+.045*o,e/=1+.015*o,Math.sqrt(r*r+a*a+e*e)}function s(t,e){return a(u.apply(void 0,t),u.apply(void 0,e))}Object.defineProperty(n,"__esModule",{value:!0}),n.getColorIndex=n.getColorDiffStatus=n.hexDiff=n.rgbDiff=n.deltaE94=n.rgbToCIELab=n.xyzToCIELab=n.rgbToXyz=n.hslToRgb=n.rgbToHsl=n.rgbToHex=n.hexToRgb=n.defer=n.RSHIFT=n.SIGBITS=n.DELTAE94_DIFF_STATUS=void 0,n.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},n.SIGBITS=5,n.RSHIFT=8-n.SIGBITS,n.defer=function(){var r,n,t=new Promise(function(t,e){r=t,n=e});return{resolve:r,reject:n,promise:t}},n.hexToRgb=r,n.rgbToHex=function(t,e,r){return"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1,7)},n.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;var n,o=Math.max(t,e,r),i=Math.min(t,e,r),u=(o+i)/2;if(o===i)n=s=0;else{var a=o-i,s=.5<u?a/(2-o-i):a/(o+i);switch(o){case t:n=(e-r)/a+(e<r?6:0);break;case e:n=(r-t)/a+2;break;case r:n=(t-e)/a+4}n/=6}return[n,s,u]},n.hslToRgb=function(t,e,r){var n,o,i;function u(t,e,r){return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}return 0===e?n=o=i=r:(n=u(e=2*r-(r=r<.5?r*(1+e):r+e-r*e),r,t+1/3),o=u(e,r,t),i=u(e,r,t-1/3)),[255*n,255*o,255*i]},n.rgbToXyz=o,n.xyzToCIELab=i,n.rgbToCIELab=u,n.deltaE94=a,n.rgbDiff=s,n.hexDiff=function(t,e){return s(r(t),r(e))},n.getColorDiffStatus=function(t){return t<n.DELTAE94_DIFF_STATUS.NA?"N/A":t<=n.DELTA