'use strict'; var _=(e,t={})=>{let{minimum:o=Number.NEGATIVE_INFINITY,maximum:n=Number.POSITIVE_INFINITY}=t;return e>=o&&e<=n},u=(e,t={})=>{let{minimum:o=Number.NEGATIVE_INFINITY,maximum:n=Number.POSITIVE_INFINITY}=t;return _(e,{minimum:o,maximum:n})?e:Math.min(Math.max(e,o),n)},y=(e,t={})=>{let{minimum:o=Number.MIN_SAFE_INTEGER,maximum:n=Number.MAX_SAFE_INTEGER}=t;if(!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(e))throw new RangeError("Infinity numbers for modulo not allowed");let r=n-1;return _(e,{minimum:o,maximum:r})?e:((e-o)%(r-o+1)+(r-o+1))%(r-o+1)+o};var E=0,A=1,O=A,N=(e,t,o=O)=>Object.freeze({_tag:e,alpha:Math.round(u(o,{minimum:E,maximum:A})*100)/100,components:Object.freeze(Object.assign({},t))}),d=(e,t)=>({alpha:o,...n})=>N(e,Object.entries(t).reduce((r,[s,m])=>({...r,[s]:m(n[s])}),{}),o),S=(e,t,o=({alpha:n,...r})=>N(t._tag,r,n))=>{let n=Object.entries(t.components).reduce((r,[s,m])=>({...r,[s]:e[s]??m}),{alpha:e.alpha||t.alpha});return o(n)},M=(e,t)=>S({alpha:t.alpha+e,...t.components},t),D=(e,t)=>M(-e,t),l=(e,t)=>{let o=(s,m)=>S({[e]:s},m,t),n=(s,m)=>o(m.components[e]+s,m);return {set:o,increase:n,decrease:(s,m)=>n(-s,m)}};var V=0,P=255,F="RGB",G=e=>Math.round(u(e,{minimum:V,maximum:P})),c=d(F,{red:G,green:G,blue:G}),q=e=>e._tag===F,R=l("red",c),v=R.set,ee=R.increase,oe=R.decrease,h=l("green",c),te=h.set,ne=h.increase,re=h.decrease,g=l("blue",c),se=g.set,me=g.increase,ae=g.decrease;var w=0,$=360,j=0,X=100,H="HSL",k=e=>Math.round(y(e,{minimum:w,maximum:$})),L=e=>Math.round(u(e,{minimum:j,maximum:X})),x=d(H,{hue:k,lightness:L,saturation:L}),Ce=e=>e._tag===H,I=l("hue",x),xe=I.set,de=I.increase,T=l("lightness",x),be=T.set,Ge=T.increase,Re=T.decrease,B=l("saturation",x),he=B.set,ge=B.increase,Te=B.decrease;var Ne=(e,t)=>{let o=t.alpha,n=e.alpha*(1-t.alpha),r=o+n,s=(t.components.red*o+e.components.red*n)/r,m=(t.components.green*o+e.components.green*n)/r,a=(t.components.blue*o+e.components.blue*n)/r;return c({red:s,green:m,blue:a,alpha:r})},Se=(e,t,o)=>{let n=u(o,{minimum:0,maximum:1}),r=1-n,s=n,m=e.components.red*r+t.components.red*s,a=e.components.green*r+t.components.green*s,i=e.components.blue*r+t.components.blue*s,p=e.alpha*r+t.alpha*s;return c({red:m,green:a,blue:i,alpha:p})};var f=(e,t,o)=>(o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+(t-e)*(6*o):o<1/2?t:o<2/3?e+(t-e)*((2/3-o)*6):e),Me=e=>{let t=e.components.hue/360,o=e.components.saturation/100,n=e.components.lightness/100;if(o===0){let p=n*255;return c({red:p,green:p,blue:p,alpha:e.alpha})}let r=n<.5?n*(1+o):n+o-n*o,s=2*n-r,m=f(s,r,t+1/3)*255,a=f(s,r,t)*255,i=f(s,r,t-1/3)*255;return c({red:m,green:a,blue:i,alpha:e.alpha})},Ve=e=>{let t=e.components.red/255,o=e.components.green/255,n=e.components.blue/255,r=e.alpha,s=Math.min(t,o,n),m=Math.max(t,o,n),a=m-s,i=(s+m)/2,p=0,b=0;if(a===0)return x({hue:p*360,saturation:b*100,lightness:i*100,alpha:r});switch(b=a/(1-Math.abs(2*i-1)),m){case t:p=(o-n)/a%6;break;case o:p=(n-t)/a+2;break;default:p=(t-o)/a+4;}return x({hue:p*60,saturation:b*100,lightness:i*100,alpha:r})},Pe=e=>{let[t,o]=e.slice(4,-1).split("/"),[n,r,s]=t.split(" "),m=typeof o<"u"?+o:1,a=+n,i=+r,p=+s;return c({blue:p,green:i,red:a,alpha:m})}; exports.DEFAULT_ALPHA = O; exports.HSL2RGB = Me; exports.HSL_TAG = H; exports.MAX_ALPHA = A; exports.MAX_HUE = $; exports.MAX_PERCENTAGE = X; exports.MAX_RGB_COMPONENT = P; exports.MIN_ALPHA = E; exports.MIN_HUE = w; exports.MIN_PERCENTAGE = j; exports.MIN_RGB_COMPONENT = V; exports.RGB2HSL = Ve; exports.RGBFromFormatString = Pe; exports.RGB_TAG = F; exports.alphaBlendingRGB = Ne; exports.clamp = u; exports.createColor = N; exports.createColorComponentOperations = l; exports.createColorFactory = d; exports.createHSLColor = x; exports.createRGBColor = c; exports.darken = Re; exports.decreaseBlue = ae; exports.decreaseGreen = re; exports.decreaseRed = oe; exports.desaturate = Te; exports.inRange = _; exports.increaseBlue = me; exports.increaseGreen = ne; exports.increaseRed = ee; exports.isHSLColor = Ce; exports.isRGBColor = q; exports.lighten = Ge; exports.mixRGB = Se; exports.modifyColor = S; exports.modulo = y; exports.opacify = M; exports.rotateHue = de; exports.saturate = ge; exports.setBlue = se; exports.setGreen = te; exports.setHue = xe; exports.setLightness = be; exports.setRed = v; exports.setSaturation = he; exports.transparentize = D;