5 lines
59 KiB
JavaScript
5 lines
59 KiB
JavaScript
|
var culori=(()=>{var Sr=Object.defineProperty;var an=Object.getOwnPropertyDescriptor;var fn=Object.getOwnPropertyNames;var ln=Object.prototype.hasOwnProperty;var pn=(e,t)=>{for(var r in t)Sr(e,r,{get:t[r],enumerable:!0})},un=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of fn(t))!ln.call(e,n)&&n!==r&&Sr(e,n,{get:()=>t[n],enumerable:!(o=an(t,n))||o.enumerable});return e};var mn=e=>un(Sr({},"__esModule",{value:!0}),e);var Oi={};pn(Oi,{a98:()=>ii,average:()=>a0,averageAngle:()=>H,averageNumber:()=>Dr,blend:()=>v0,blerp:()=>jt,clampChroma:()=>D0,clampGamut:()=>kr,clampRgb:()=>q0,colorsNamed:()=>Pt,convertA98ToXyz65:()=>tt,convertCubehelixToRgb:()=>Zt,convertDlchToLab65:()=>ye,convertHsiToRgb:()=>nt,convertHslToRgb:()=>ft,convertHsvToRgb:()=>ze,convertHwbToRgb:()=>ut,convertJabToJch:()=>st,convertJabToRgb:()=>De,convertJabToXyz65:()=>Ae,convertJchToJab:()=>dt,convertLab65ToDlch:()=>Te,convertLab65ToRgb:()=>re,convertLab65ToXyz65:()=>Ne,convertLabToLch:()=>I,convertLabToRgb:()=>Ee,convertLabToXyz50:()=>se,convertLchToLab:()=>A,convertLchuvToLuv:()=>ht,convertLrgbToOklab:()=>Ye,convertLrgbToRgb:()=>j,convertLuvToLchuv:()=>ct,convertLuvToXyz50:()=>_e,convertOkhslToOklab:()=>Be,convertOkhsvToOklab:()=>Fe,convertOklabToLrgb:()=>U,convertOklabToOkhsl:()=>Ge,convertOklabToOkhsv:()=>Ze,convertOklabToRgb:()=>ae,convertP3ToXyz65:()=>gt,convertProphotoToXyz50:()=>yt,convertRec2020ToXyz65:()=>zt,convertRgbToCubehelix:()=>Bt,convertRgbToHsi:()=>at,convertRgbToHsl:()=>it,convertRgbToHsv:()=>ke,convertRgbToHwb:()=>mt,convertRgbToJab:()=>qe,convertRgbToLab:()=>je,convertRgbToLab65:()=>oe,convertRgbToLrgb:()=>J,convertRgbToOklab:()=>ne,convertRgbToXyb:()=>ir,convertRgbToXyz50:()=>W,convertRgbToXyz65:()=>E,convertRgbToYiq:()=>mr,convertXybToRgb:()=>lr,convertXyz50ToLab:()=>de,convertXyz50ToLuv:()=>we,convertXyz50ToProphoto:()=>Mt,convertXyz50ToRgb:()=>F,convertXyz50ToXyz65:()=>ur,convertXyz65ToA98:()=>rt,convertXyz65ToJab:()=>Ie,convertXyz65ToLab65:()=>$e,convertXyz65ToP3:()=>vt,convertXyz65ToRec2020:()=>Tt,convertXyz65ToRgb:()=>Y,convertXyz65ToXyz50:()=>pr,convertYiqToRgb:()=>sr,converter:()=>g,cubehelix:()=>li,differenceCie76:()=>Vo,differenceCie94:()=>e0,differenceCiede2000:()=>t0,differenceCmc:()=>r0,differenceEuclidean:()=>pe,differenceHueChroma:()=>te,differenceHueNaive:()=>Ft,differenceHueSaturation:()=>ee,differenceHyab:()=>o0,differenceKotsarenkoRamos:()=>n0,displayable:()=>zr,dlab:()=>pi,dlch:()=>ui,easingGamma:()=>Tr,easingInOutSine:()=>rn,easingMidpoint:()=>xr,easingSmootherstep:()=>tn,easingSmoothstep:()=>V0,easingSmoothstepInverse:()=>en,filterBrightness:()=>j0,filterContrast:()=>Y0,filterDeficiencyDeuter:()=>K0,filterDeficiencyProt:()=>U0,filterDeficiencyTrit:()=>Q0,filterGrayscale:()=>Z0,filterHueRotate:()=>W0,filterInvert:()=>F0,filterSaturate:()=>B0,filterSepia:()=>G0,fixupAlpha:()=>M,fixupHueDecreasing:()=>Zo,fixupHueIncreasing:()=>Bo,fixupHueLonger:()=>Go,fixupHueShorter:()=>w,formatCss:()=>c0,formatHex:()=>h0,formatHex8:()=>b0,formatHsl:()=>g0,formatRgb:()=>x0,getMode:()=>L,hsi:()=>mi,hsl:()=>si,hsv:()=>di,hwb:()=>ci,inGamut:()=>wt,interpolate:()=>L0,interpolateWith:()=>So,interpolateWithPremultipliedAlpha:()=>R0,interpolatorLinear:()=>u,interpolatorPiecewise:()=>Yt,interpolatorSplineBasis:()=>Mr,interpolatorSplineBasisClosed:()=>yr,interpolatorSplineMonotone:()=>X0,interpolatorSplineMonotone2:()=>P0,interpolatorSplineMonotoneClosed:()=>N0,interpolatorSplineNatural:()=>H0,interpolatorSplineNaturalClosed:()=>S0,jab:()=>hi,jch:()=>bi,lab:()=>xi,lab65:()=>gi,lch:()=>vi,lch65:()=>Mi,lchuv:()=>yi,lerp:()=>V,lrgb:()=>Ti,luv:()=>zi,mapAlphaDivide:()=>br,mapAlphaMultiply:()=>hr,mapTransferGamma:()=>y0,mapTransferLinear:()=>Rt,mapper:()=>ce,modeA98:()=>Ar,modeCubehelix:()=>Jr,modeDlab:()=>Gr,modeDlch:()=>Br,modeHsi:()=>Zr,modeHsl:()=>lt,modeHsv:()=>pt,modeHwb:()=>Fr,modeJab:()=>Vr,modeJch:()=>eo,modeLab:()=>Le,modeLab65:()=>oo,modeLch:()=>Re,modeLch65:()=>no,modeLchuv:()=>ao,modeLrgb:()=>fo,modeLuv:()=>io,modeOkhsl:()=>po,modeOkhsv:()=>uo,modeOklab:()=>mo,modeOklch:()=>so,modeP3:()=>co,modeProphoto:()=>xo,mo
|
||
|
`||o===" "||o===" "){for(;x<t.length&&(t[x]===`
|
||
|
`||t[x]===" "||t[x]===" ");)x++;continue}if(o===",")return;if(o===")"){r.push({type:p.ParenClose});continue}if(o==="+"){if(x--,At(t)){r.push(et(t));continue}return}if(o==="-"){if(x--,At(t)){r.push(et(t));continue}if(Nr(t)){r.push({type:p.Ident,value:Dt(t)});continue}return}if(o==="."){if(x--,At(t)){r.push(et(t));continue}return}if(o==="/"){for(;x<t.length&&(t[x]===`
|
||
|
`||t[x]===" "||t[x]===" ");)x++;let n;if(At(t)&&(n=et(t),n.type!==p.Hue)){r.push({type:p.Alpha,value:n});continue}if(Nr(t)&&Dt(t)==="none"){r.push({type:p.Alpha,value:{type:p.None,value:void 0}});continue}return}if(/\d/.test(o)){x--,r.push(et(t));continue}if(Pr.test(o)){x--,r.push(Rn(t));continue}return}return r}function _n(e){e._i=0;let t=e[e._i++];if(!t||t.type!==p.Function||t.value!=="color"||(t=e[e._i++],t.type!==p.Ident))return;let r=It[t.value];if(!r)return;let o={mode:r},n=Eo(e,!1);if(!n)return;let a=L(r).channels;for(let f=0,i;f<a.length;f++)i=n[f],i.type!==p.None&&(o[a[f]]=i.type===p.Number?i.value:i.value/100);return o}function Eo(e,t){let r=[],o;for(;e._i<e.length;){if(o=e[e._i++],o.type===p.None||o.type===p.Number||o.type===p.Alpha||o.type===p.Percentage||t&&o.type===p.Hue){r.push(o);continue}if(o.type===p.ParenClose){if(e._i<e.length)return;continue}return}if(!(r.length<3||r.length>4)){if(r.length===4){if(r[3].type!==p.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:p.None,value:void 0}),r.every(n=>n.type!==p.Alpha)?r:void 0}}function Hn(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==p.Function)return;let o=Eo(e,t);if(o)return o.unshift(r.value),o}var Sn=e=>{if(typeof e!="string")return;let t=wn(e),r=t?Hn(t,!0):void 0,o,n=0,a=ve.length;for(;n<a;)if((o=ve[n++](e,r))!==void 0)return o;return t?_n(t):void 0},Ot=Sn;function Xn(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let r={mode:"rgb"},[,o,n,a,f]=t;if(!(o.type===p.Hue||n.type===p.Hue||a.type===p.Hue))return o.type!==p.None&&(r.r=o.type===p.Number?o.value/255:o.value/100),n.type!==p.None&&(r.g=n.type===p.Number?n.value/255:n.value/100),a.type!==p.None&&(r.b=a.type===p.Number?a.value/255:a.value/100),f.type!==p.None&&(r.alpha=f.type===p.Number?f.value:f.value/100),r}var Jt=Xn;var Pn=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Et=Pn;var V=(e,t,r)=>e+r*(t-e),jo=(e,t,r)=>(r-e)/(t-e),jt=(e,t,r,o,n,a)=>V(V(e,t,n),V(r,o,n),a),Yo=(e,t,r,o,n,a,f,i,l,m,s)=>V(jt(e,t,r,o,l,m),jt(n,a,f,i,l,m),s);var Nn=e=>{let t=[];for(let r=0;r<e.length-1;r++){let o=e[r],n=e[r+1];o===void 0&&n===void 0?t.push(void 0):o!==void 0&&n!==void 0?t.push([o,n]):t.push(o!==void 0?[o,o]:[n,n])}return t},Yt=e=>t=>{let r=Nn(t);return o=>{let n=o*r.length,a=o>=1?r.length-1:Math.max(Math.floor(n),0),f=r[a];return f===void 0?void 0:e(f[0],f[1],n-a)}};var u=Yt(V);var M=e=>{let t=!1,r=e.map(o=>o!==void 0?(t=!0,o):1);return t?r:e};var $n={mode:"rgb",channels:["r","g","b","alpha"],parse:[Jt,$t,Ct,Nt,Et,"srgb"],serialize:"srgb",interpolate:{r:u,g:u,b:u,alpha:{use:u,fixup:M}},gamut:!0},G=$n;var $r=e=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),Cn=e=>{let t=$r(e.r),r=$r(e.g),o=$r(e.b),n={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*o,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*o,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*o};return e.alpha!==void 0&&(n.alpha=e.alpha),n},tt=Cn;var Cr=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),On=({x:e,y:t,z:r,alpha:o})=>{let n={mode:"a98",r:Cr(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:Cr(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:Cr(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return o!==void 0&&(n.alpha=o),n},rt=On;var Or=e=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},In=({r:e,g:t,b:r,alpha:o})=>{let n={mode:"lrgb",r:Or(e),g:Or(t),b:Or(r)};return o!==void 0&&(n.alpha=o),n},J=In;var An=e=>{let{r:t,g:r,b:o,alpha:n}=J(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*o,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*o,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*o};return n!==void 0&&(a.alpha=n),a},E=An;var Ir=e=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},qn=({r:e,g:t,b:r,alpha:o},n="rgb")=>{let a={mode:n,r:Ir(e),g:Ir(t),b:Ir(r)};return o!==void 0&&(a.alpha=o),a},j=qn;var Dn=({x:e,y:t,z:r,alpha:o})=>{let n=j({r:e*3.2409699419045226-t*1.537383177570094-
|