function t(t,r){(function(t){return"string"==typeof t&&-1!==t.indexof(".")&&1===parsefloat(t)})(t)&&(t="100%");var e=function(t){return"string"==typeof t&&-1!==t.indexof("%")}(t);return t=360===r?t:math.min(r,math.max(0,parsefloat(t))),e&&(t=parseint(string(t*r),10)/100),math.abs(t-r)<1e-6?1:t=360===r?(t<0?t%r+r:t%r)/parsefloat(string(r)):t%r/parsefloat(string(r))}function r(t){return math.min(1,math.max(0,t))}function e(t){return t=parsefloat(t),(isnan(t)||t<0||t>1)&&(t=1),t}function n(t){return t<=1?"".concat(100*number(t),"%"):t}function a(t){return 1===t.length?"0"+t:string(t)}function o(r,e,n){r=t(r,255),e=t(e,255),n=t(n,255);var a=math.max(r,e,n),o=math.min(r,e,n),i=0,h=0,s=(a+o)/2;if(a===o)h=0,i=0;else{var f=a-o;switch(h=s>.5?f/(2-a-o):f/(a+o),a){case r:i=(e-n)/f+(e1&&(e-=1),e<1/6?t+6*e*(r-t):e<.5?r:e<2/3?t+(r-t)*(2/3-e)*6:t}function h(r,e,n){r=t(r,255),e=t(e,255),n=t(n,255);var a=math.max(r,e,n),o=math.min(r,e,n),i=0,h=a,s=a-o,f=0===a?0:s/a;if(a===o)i=0;else{switch(a){case r:i=(e-n)/s+(e>16,g:(65280&t)>>8,b:255&t}}(t)),this.originalinput=t;var a=g(t);this.originalinput=t,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.rounda=math.round(100*this.a)/100,this.format=null!==(e=r.format)&&void 0!==e?e:a.format,this.gradienttype=r.gradienttype,this.r<1&&(this.r=math.round(this.r)),this.g<1&&(this.g=math.round(this.g)),this.b<1&&(this.b=math.round(this.b)),this.isvalid=a.ok}return n.prototype.isdark=function(){return this.getbrightness()<128},n.prototype.islight=function(){return!this.isdark()},n.prototype.getbrightness=function(){var t=this.torgb();return(299*t.r+587*t.g+114*t.b)/1e3},n.prototype.getluminance=function(){var t=this.torgb(),r=t.r/255,e=t.g/255,n=t.b/255;return.2126*(r<=.03928?r/12.92:math.pow((r+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:math.pow((n+.055)/1.055,2.4))},n.prototype.getalpha=function(){return this.a},n.prototype.setalpha=function(t){return this.a=e(t),this.rounda=math.round(100*this.a)/100,this},n.prototype.ismonochrome=function(){return 0===this.tohsl().s},n.prototype.tohsv=function(){var t=h(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},n.prototype.tohsvstring=function(){var t=h(this.r,this.g,this.b),r=math.round(360*t.h),e=math.round(100*t.s),n=math.round(100*t.v);return 1===this.a?"hsv(".concat(r,", ").concat(e,"%, ").concat(n,"%)"):"hsva(".concat(r,", ").concat(e,"%, ").concat(n,"%, ").concat(this.rounda,")")},n.prototype.tohsl=function(){var t=o(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},n.prototype.tohslstring=function(){var t=o(this.r,this.g,this.b),r=math.round(360*t.h),e=math.round(100*t.s),n=math.round(100*t.l);return 1===this.a?"hsl(".concat(r,", ").concat(e,"%, ").concat(n,"%)"):"hsla(".concat(r,", ").concat(e,"%, ").concat(n,"%, ").concat(this.rounda,")")},n.prototype.tohex=function(t){return void 0===t&&(t=!1),s(this.r,this.g,this.b,t)},n.prototype.tohexstring=function(t){return void 0===t&&(t=!1),"#"+this.tohex(t)},n.prototype.tohex8=function(t){return void 0===t&&(t=!1),function(t,r,e,n,o){var i,h=[a(math.round(t).tostring(16)),a(math.round(r).tostring(16)),a(math.round(e).tostring(16)),a((i=n,math.round(255*parsefloat(i)).tostring(16)))];return o&&h[0].startswith(h[0].charat(1))&&h[1].startswith(h[1].charat(1))&&h[2].startswith(h[2].charat(1))&&h[3].startswith(h[3].charat(1))?h[0].charat(0)+h[1].charat(0)+h[2].charat(0)+h[3].charat(0):h.join("")}(this.r,this.g,this.b,this.a,t)},n.prototype.tohex8string=function(t){return void 0===t&&(t=!1),"#"+this.tohex8(t)},n.prototype.tohexshortstring=function(t){return void 0===t&&(t=!1),1===this.a?this.tohexstring(t):this.tohex8string(t)},n.prototype.torgb=function(){return{r:math.round(this.r),g:math.round(this.g),b:math.round(this.b),a:this.a}},n.prototype.torgbstring=function(){var t=math.round(this.r),r=math.round(this.g),e=math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(r,", ").concat(e,")"):"rgba(".concat(t,", ").concat(r,", ").concat(e,", ").concat(this.rounda,")")},n.prototype.topercentagergb=function(){var r=function(r){return"".concat(math.round(100*t(r,255)),"%")};return{r:r(this.r),g:r(this.g),b:r(this.b),a:this.a}},n.prototype.topercentagergbstring=function(){var r=function(r){return math.round(100*t(r,255))};return 1===this.a?"rgb(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%)"):"rgba(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%, ").concat(this.rounda,")")},n.prototype.toname=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+s(this.r,this.g,this.b,!1),r=0,e=object.entries(u);r=0;return r||!n||!t.startswith("hex")&&"name"!==t?("rgb"===t&&(e=this.torgbstring()),"prgb"===t&&(e=this.topercentagergbstring()),"hex"!==t&&"hex6"!==t||(e=this.tohexstring()),"hex3"===t&&(e=this.tohexstring(!0)),"hex4"===t&&(e=this.tohex8string(!0)),"hex8"===t&&(e=this.tohex8string()),"name"===t&&(e=this.toname()),"hsl"===t&&(e=this.tohslstring()),"hsv"===t&&(e=this.tohsvstring()),e||this.tohexstring()):"name"===t&&0===this.a?this.toname():this.torgbstring()},n.prototype.tonumber=function(){return(math.round(this.r)<<16)+(math.round(this.g)<<8)+math.round(this.b)},n.prototype.clone=function(){return new n(this.tostring())},n.prototype.lighten=function(t){void 0===t&&(t=10);var e=this.tohsl();return e.l+=t/100,e.l=r(e.l),new n(e)},n.prototype.brighten=function(t){void 0===t&&(t=10);var r=this.torgb();return r.r=math.max(0,math.min(255,r.r-math.round(-t/100*255))),r.g=math.max(0,math.min(255,r.g-math.round(-t/100*255))),r.b=math.max(0,math.min(255,r.b-math.round(-t/100*255))),new n(r)},n.prototype.darken=function(t){void 0===t&&(t=10);var e=this.tohsl();return e.l-=t/100,e.l=r(e.l),new n(e)},n.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},n.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},n.prototype.desaturate=function(t){void 0===t&&(t=10);var e=this.tohsl();return e.s-=t/100,e.s=r(e.s),new n(e)},n.prototype.saturate=function(t){void 0===t&&(t=10);var e=this.tohsl();return e.s+=t/100,e.s=r(e.s),new n(e)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(t){var r=this.tohsl(),e=(r.h+t)%360;return r.h=e<0?360+e:e,new n(r)},n.prototype.mix=function(t,r){void 0===r&&(r=50);var e=this.torgb(),a=new n(t).torgb(),o=r/100;return new n({r:(a.r-e.r)*o+e.r,g:(a.g-e.g)*o+e.g,b:(a.b-e.b)*o+e.b,a:(a.a-e.a)*o+e.a})},n.prototype.analogous=function(t,r){void 0===t&&(t=6),void 0===r&&(r=30);var e=this.tohsl(),a=360/r,o=[this];for(e.h=(e.h-(a*t>>1)+720)%360;--t;)e.h=(e.h+a)%360,o.push(new n(e));return o},n.prototype.complement=function(){var t=this.tohsl();return t.h=(t.h+180)%360,new n(t)},n.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var r=this.tohsv(),e=r.h,a=r.s,o=r.v,i=[],h=1/t;t--;)i.push(new n({h:e,s:a,v:o})),o=(o+h)%1;return i},n.prototype.splitcomplement=function(){var t=this.tohsl(),r=t.h;return[this,new n({h:(r+72)%360,s:t.s,l:t.l}),new n({h:(r+216)%360,s:t.s,l:t.l})]},n.prototype.onbackground=function(t){var r=this.torgb(),e=new n(t).torgb(),a=r.a+e.a*(1-r.a);return new n({r:(r.r*r.a+e.r*e.a*(1-r.a))/a,g:(r.g*r.a+e.g*e.a*(1-r.a))/a,b:(r.b*r.a+e.b*e.a*(1-r.a))/a,a:a})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(t){for(var r=this.tohsl(),e=r.h,a=[this],o=360/t,i=1;i