import{casv}from"./clone.06747a68.js";import{casf}from"./color-convert.755d189f.js";import{c}from"./color-string.e356f5de.js";varg=v.exports,b=f,i=c,u=function(t){if(tinstanceofu)returnt;if(!(thisinstanceofu))returnnewu(t);this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};vare;if(typeoft=="string")if(e=i.getRgba(t),e)this.setValues("rgb",e);elseif(e=i.getHsla(t))this.setValues("hsl",e);elseif(e=i.getHwb(t))this.setValues("hwb",e);elsethrownewError('Unable to parse color from string "'+t+'"');elseif(typeoft=="object")if(e=t,e.r!==void0||e.red!==void0)this.setValues("rgb",e);elseif(e.l!==void0||e.lightness!==void0)this.setValues("hsl",e);elseif(e.v!==void0||e.value!==void0)this.setValues("hsv",e);elseif(e.w!==void0||e.whiteness!==void0)this.setValues("hwb",e);elseif(e.c!==void0||e.cyan!==void0)this.setValues("cmyk",e);elsethrownewError("Unable to parse color from object "+JSON.stringify(t))};u.prototype={rgb:function(){returnthis.setSpace("rgb",arguments)},hsl:function(){returnthis.setSpace("hsl",arguments)},hsv:function(){returnthis.setSpace("hsv",arguments)},hwb:function(){returnthis.setSpace("hwb",arguments)},cmyk:function(){returnthis.setSpace("cmyk",arguments)},rgbArray:function(){returnthis.values.rgb},hslArray:function(){returnthis.values.hsl},hsvArray:function(){returnthis.values.hsv},hwbArray:function(){returnthis.values.alpha!==1?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){returnthis.values.cmyk},rgbaArray:function(){vart=this.values.rgb;returnt.concat([this.values.alpha])},rgbaArrayNormalized:function(){for(vart=this.values.rgb,e=[],s=0;s<3;s++)e[s]=t[s]/255;returne.push(this.values.alpha),e},hslaArray:function(){vart=this.values.hsl;returnt.concat([this.values.alpha])},alpha:function(t){returnt===void0?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){returnthis.setChannel("rgb",0,t)},green:function(t){returnthis.setChannel("rgb",1,t)},blue:function(t){returnthis.setChannel("rgb",2,t)},hue:function(t){returnt&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){returnthis.setChannel("hsl",1,t)},lightness:function(t){returnthis.setChannel("hsl",2,t)},saturationv:function(t){returnthis.setChannel("hsv",1,t)},whiteness:function(t){returnthis.setChannel("hwb",1,t)},blackness:function(t){returnthis.setChannel("hwb",2,t)},value:function(t){returnthis.setChannel("hsv",2,t)},cyan:function(t){returnthis.setChannel("cmyk",0,t)},magenta:function(t){returnthis.setChannel("cmyk",1,t)},yellow:function(t){returnthis.setChannel("cmyk",2,t)},black:function(t){returnthis.setChannel("cmyk",3,t)},hexString:function(){returni.hexString(this.values.rgb)},rgbString:function(){returni.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){returni.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){returni.percentString(this.values.rgb,this.values.alpha)},hslString:function(){returni.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){returni.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){returni.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){returni.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){returnthis.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(vart=this.values.rgb,e=[],s=0;s<t.length;s++){varn=t[s]/255;e[s]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){vare=this.luminosity(),s=t.luminosity();returne>s?(e+.05)/(s+.05):(s+.05)/(e+.05)},level:function(t){vare=this.contrast(t);returne>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){vart=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;returne<128},light:function(){return!this.dark()},negate:function(){for(vart=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];returnthis.setValues("rgb",t),this},lighten:function(t){returnthis.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this