import {m,c,a,p,o,n,r,s,h,g,i,f}from'../chunk-YQKSXMBN.mjs';import'../chunk-WGY6QKPW.mjs';import'../chunk-GLKEY6D3.mjs';import {b,a as a$1}from'../chunk-IOXRZECH.mjs';var d=(b$1,f$1,x)=>{b$1.prototype.toLab=function(t=2){let{l:a,a:r,b:n,alpha:o}=m(this._rawRgb());return {l:b(a,t),a:b(r,t)||0,b:b(n,t)||0,alpha:o,colorSpace:"lab"}},b$1.prototype.toLabString=function(t=2){let{l:a,a:r,b:n,alpha:o}=this.toLab(t);return o<1?`lab(${a} ${r} ${n} / ${o})`:`lab(${a} ${r} ${n})`},b$1.prototype.toXyz=function(t=2){let{x:a,y:r,z:n,alpha:o}=c(this._rawRgb());return {x:b(a,t),y:b(r,t),z:b(n,t),alpha:o}},b$1.prototype.toXyzString=function(t=2){let{x:a,y:r,z:n,alpha:o}=this.toXyz(t);return o<1?`color(xyz-d50 ${a} ${r} ${n} / ${o})`:`color(xyz-d50 ${a} ${r} ${n})`},b$1.prototype.toXyzD65=function(t=2){let{x:a$1,y:r,z:n,alpha:o}=a(this._rawRgb());return {x:b(a$1,t),y:b(r,t),z:b(n,t),alpha:o,colorSpace:"xyz-d65"}},b$1.prototype.toXyzD65String=function(t=2){let{x:a,y:r,z:n,alpha:o}=this.toXyzD65(t);return o<1?`color(xyz-d65 ${a} ${r} ${n} / ${o})`:`color(xyz-d65 ${a} ${r} ${n})`},b$1.prototype.mixLab=function(t,a=.5){let r=m(this._rawRgb()),n=m(new b$1(t)._rawRgb()),o=a$1(a,0,1);return new b$1(p({l:r.l*(1-o)+n.l*o,a:r.a*(1-o)+n.a*o,b:r.b*(1-o)+n.b*o,alpha:b(r.alpha*(1-o)+n.alpha*o,3),colorSpace:"lab"}))},b$1.prototype.delta=function(t="#fff"){return b(o(n(this._rawRgb()),n(new b$1(t)._rawRgb()))/100,3)},f$1.push(r,s,h,g,i,f),x.push([r,"lab"],[s,"lab"],[h,"xyz-d65"],[g,"xyz-d65"],[i,"xyz"],[f,"xyz"]);},w=d;export{w as default};//# sourceMappingURL=lab.mjs.map
//# sourceMappingURL=lab.mjs.map