(()=>{var r={991:(r,t)=>{t.GAMMA=.43,t.L1=.055,t.L2=12.92,t.C1=10.31475,t.C2=.0031308,t.RATIO=2.4,t.rGAMMA=1/t.GAMMA},950:(r,t,n)=>{function e(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;i(this,r),this.steps=e,t&&n&&this.setColors(t,n)}var t,n;return t=r,(n=[{key:"gens",value:function(r){var t,n=this;return this.steps=+r-1,(t=Array(r).keys(),function(r){if(Array.isArray(r))return e(r)}(t)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(t)||function(r,t){if(r){if("string"==typeof r)return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(r,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(r){return n.gen(r)}))}},{key:"gen",value:function(r,t){var n=this;if(void 0!==t&&(this.steps=t),!this.steps||!r)return a.rgb2hex(this.color1);r/=this.steps;var e=this.linear1.map((function(t,e){return a.lerp(t,n.linear2[e],r)})),i=e.reduce((function(r,t){return r+t}),0);if(0!=i){var o=Math.pow(a.lerp(this.bias1,this.bias2,r),u.rGAMMA)/i;e=e.map((function(r){return r*o}))}return a.rgb2hex(a.linear2rgb(e))}},{key:"setSteps",value:function(r){this.steps=r}},{key:"setColors",value:function(r,t){this.color1=a.color2rgb(r),this.color2=a.color2rgb(t),this.linear1=a.rgb2linear(this.color1),this.linear2=a.rgb2linear(this.color2),this.bias1=Math.pow(this.linear1.reduce((function(r,t){return r+t}),0),u.GAMMA),this.bias2=Math.pow(this.linear2.reduce((function(r,t){return r+t}),0),u.GAMMA)}}])&&o(t.prototype,n),r}();r.exports=s},579:(r,t,n)=>{var e=n(950),i=n(839);"undefined"!=typeof window&&(window.GenGradientColor=e,window.GenGradientColor.util=i),r.exports={GenGradientColor:e,util:i}},839:(r,t,n)=>{var e=n(991);function i(r){return"string"==typeof r||r instanceof String}function o(r){var t=r.match(r.length>4?/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i:/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i);if(!t)throw new TypeError("Hex code is invalid which should be 3/6 digits");return(r.length>4?[t[1],t[2],t[3]]:[t[1].repeat(2),t[2].repeat(2),t[3].repeat(2)]).map((function(r){return parseInt(r,16)}))}function a(r){if(i(r))return o(r);if(Array.isArray(r))return r.map(u);throw new TypeError("Color must be string or array")}function u(r){var t=Math.min(255,Math.abs(+r));return isNaN(t)?0:t}r.exports={isString:i,hex2rgb:o,rgb2hex:function(r){var t=a(r).map((function(r){return r.toString(16).padStart(2,"0")})).join("");return"#".concat(t)},color2rgb:a,linear2rgb:function(r){return r.map((function(r){return Math.round(255.9999*(r<=e.C2?e.L2*r:(1+e.L1)*Math.pow(r,1/e.RATIO)-e.L1))}))},rgb2linear:function(r){return a(r).map((function(r){return r<=e.C1?r/e.L2/255:Math.pow((r/255+e.L1)/(1+e.L1),e.RATIO)}))},lerp:function(r,t,n){return r*(1-(n=Math.max(0,Math.min(1,n))))+t*n}}}},t={};!function n(e){if(t[e])return t[e].exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}(579)})(); //# sourceMappingURL=bundle.min.js.map