tailwindcss-css-variables-color-palette-plugin
Version:
Color Palette plugin using CSS variables for TailwindCSS; forked from tailwindcss-css-variables-palette-plugin
2 lines (1 loc) • 17.9 kB
JavaScript
(function(w,H){typeof exports=="object"&&typeof module<"u"?module.exports=H():typeof define=="function"&&define.amd?define(H):(w=typeof globalThis<"u"?globalThis:w||self,w["tailwindcss-palette-css-variables"]=H())})(this,function(){"use strict";var w={},H={};Object.defineProperty(H,"__esModule",{value:!0}),H.default=void 0;function N(i,a){return{handler:i,config:a}}N.withOptions=function(i,a=()=>({})){const l=function(h){return{__options:h,handler:i(h),config:a(h)}};return l.__isOptionsFunction=!0,l.__pluginFunction=i,l.__configFunction=a,l};var ee=N;H.default=ee,Object.defineProperty(w,"__esModule",{value:!0}),w.default=void 0;var te=re(H);function re(i){return i&&i.__esModule?i:{default:i}}var ne=te.default;w.default=ne;let C=w;var ae=(C.__esModule?C:{default:C}).default,L={exports:{}};(function(i){(function(a){var l=/^\s+/,h=/\s+$/,c=0,o=a.round,_=a.min,S=a.max,E=a.random;function u(e,r){if(e=e||"",r=r||{},e instanceof u)return e;if(!(this instanceof u))return new u(e,r);var t=ge(e);this._originalInput=e,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=o(100*this._a)/100,this._format=r.format||t.format,this._gradientType=r.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=t.ok,this._tc_id=c++}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,t,n,f,s,g;return r=e.r/255,t=e.g/255,n=e.b/255,r<=.03928?f=r/12.92:f=a.pow((r+.055)/1.055,2.4),t<=.03928?s=t/12.92:s=a.pow((t+.055)/1.055,2.4),n<=.03928?g=n/12.92:g=a.pow((n+.055)/1.055,2.4),.2126*f+.7152*s+.0722*g},setAlpha:function(e){return this._a=Q(e),this._roundA=o(100*this._a)/100,this},toHsv:function(){var e=X(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=X(this._r,this._g,this._b),r=o(e.h*360),t=o(e.s*100),n=o(e.v*100);return this._a==1?"hsv("+r+", "+t+"%, "+n+"%)":"hsva("+r+", "+t+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=W(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=W(this._r,this._g,this._b),r=o(e.h*360),t=o(e.s*100),n=o(e.l*100);return this._a==1?"hsl("+r+", "+t+"%, "+n+"%)":"hsla("+r+", "+t+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return Z(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return pe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(d(this._r,255)*100)+"%",g:o(d(this._g,255)*100)+"%",b:o(d(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+o(d(this._r,255)*100)+"%, "+o(d(this._g,255)*100)+"%, "+o(d(this._b,255)*100)+"%)":"rgba("+o(d(this._r,255)*100)+"%, "+o(d(this._g,255)*100)+"%, "+o(d(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Me[Z(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+J(this._r,this._g,this._b,this._a),t=r,n=this._gradientType?"GradientType = 1, ":"";if(e){var f=u(e);t="#"+J(f._r,f._g,f._b,f._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+t+")"},toString:function(e){var r=!!e;e=e||this._format;var t=!1,n=this._a<1&&this._a>=0,f=!r&&n&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return f?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(t=this.toRgbString()),e==="prgb"&&(t=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(t=this.toHexString()),e==="hex3"&&(t=this.toHexString(!0)),e==="hex4"&&(t=this.toHex8String(!0)),e==="hex8"&&(t=this.toHex8String()),e==="name"&&(t=this.toName()),e==="hsl"&&(t=this.toHslString()),e==="hsv"&&(t=this.toHsvString()),t||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(e,r){var t=e.apply(null,[this].concat([].slice.call(r)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(ye,arguments)},brighten:function(){return this._applyModification(Ae,arguments)},darken:function(){return this._applyModification(Se,arguments)},desaturate:function(){return this._applyModification(_e,arguments)},saturate:function(){return this._applyModification(me,arguments)},greyscale:function(){return this._applyModification(xe,arguments)},spin:function(){return this._applyModification(ke,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Te,arguments)},complement:function(){return this._applyCombination(we,arguments)},monochromatic:function(){return this._applyCombination(Pe,arguments)},splitcomplement:function(){return this._applyCombination(Fe,arguments)},triad:function(){return this._applyCombination(He,arguments)},tetrad:function(){return this._applyCombination(Re,arguments)}},u.fromRatio=function(e,r){if(typeof e=="object"){var t={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?t[n]=e[n]:t[n]=T(e[n]));e=t}return u(e,r)};function ge(e){var r={r:0,g:0,b:0},t=1,n=null,f=null,s=null,g=!1,b=!1;return typeof e=="string"&&(e=Ee(e)),typeof e=="object"&&(k(e.r)&&k(e.g)&&k(e.b)?(r=de(e.r,e.g,e.b),g=!0,b=String(e.r).substr(-1)==="%"?"prgb":"rgb"):k(e.h)&&k(e.s)&&k(e.v)?(n=T(e.s),f=T(e.v),r=ve(e.h,n,f),g=!0,b="hsv"):k(e.h)&&k(e.s)&&k(e.l)&&(n=T(e.s),s=T(e.l),r=be(e.h,n,s),g=!0,b="hsl"),e.hasOwnProperty("a")&&(t=e.a)),t=Q(t),{ok:g,format:e.format||b,r:_(255,S(r.r,0)),g:_(255,S(r.g,0)),b:_(255,S(r.b,0)),a:t}}function de(e,r,t){return{r:d(e,255)*255,g:d(r,255)*255,b:d(t,255)*255}}function W(e,r,t){e=d(e,255),r=d(r,255),t=d(t,255);var n=S(e,r,t),f=_(e,r,t),s,g,b=(n+f)/2;if(n==f)s=g=0;else{var v=n-f;switch(g=b>.5?v/(2-n-f):v/(n+f),n){case e:s=(r-t)/v+(r<t?6:0);break;case r:s=(t-e)/v+2;break;case t:s=(e-r)/v+4;break}s/=6}return{h:s,s:g,l:b}}function be(e,r,t){var n,f,s;e=d(e,360),r=d(r,100),t=d(t,100);function g(m,P,A){return A<0&&(A+=1),A>1&&(A-=1),A<1/6?m+(P-m)*6*A:A<1/2?P:A<2/3?m+(P-m)*(2/3-A)*6:m}if(r===0)n=f=s=t;else{var b=t<.5?t*(1+r):t+r-t*r,v=2*t-b;n=g(v,b,e+1/3),f=g(v,b,e),s=g(v,b,e-1/3)}return{r:n*255,g:f*255,b:s*255}}function X(e,r,t){e=d(e,255),r=d(r,255),t=d(t,255);var n=S(e,r,t),f=_(e,r,t),s,g,b=n,v=n-f;if(g=n===0?0:v/n,n==f)s=0;else{switch(n){case e:s=(r-t)/v+(r<t?6:0);break;case r:s=(t-e)/v+2;break;case t:s=(e-r)/v+4;break}s/=6}return{h:s,s:g,v:b}}function ve(e,r,t){e=d(e,360)*6,r=d(r,100),t=d(t,100);var n=a.floor(e),f=e-n,s=t*(1-r),g=t*(1-f*r),b=t*(1-(1-f)*r),v=n%6,m=[t,g,s,s,b,t][v],P=[b,t,t,g,s,s][v],A=[s,s,b,t,t,g][v];return{r:m*255,g:P*255,b:A*255}}function Z(e,r,t,n){var f=[x(o(e).toString(16)),x(o(r).toString(16)),x(o(t).toString(16))];return n&&f[0].charAt(0)==f[0].charAt(1)&&f[1].charAt(0)==f[1].charAt(1)&&f[2].charAt(0)==f[2].charAt(1)?f[0].charAt(0)+f[1].charAt(0)+f[2].charAt(0):f.join("")}function pe(e,r,t,n,f){var s=[x(o(e).toString(16)),x(o(r).toString(16)),x(o(t).toString(16)),x(Y(n))];return f&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function J(e,r,t,n){var f=[x(Y(n)),x(o(e).toString(16)),x(o(r).toString(16)),x(o(t).toString(16))];return f.join("")}u.equals=function(e,r){return!e||!r?!1:u(e).toRgbString()==u(r).toRgbString()},u.random=function(){return u.fromRatio({r:E(),g:E(),b:E()})};function _e(e,r){r=r===0?0:r||10;var t=u(e).toHsl();return t.s-=r/100,t.s=I(t.s),u(t)}function me(e,r){r=r===0?0:r||10;var t=u(e).toHsl();return t.s+=r/100,t.s=I(t.s),u(t)}function xe(e){return u(e).desaturate(100)}function ye(e,r){r=r===0?0:r||10;var t=u(e).toHsl();return t.l+=r/100,t.l=I(t.l),u(t)}function Ae(e,r){r=r===0?0:r||10;var t=u(e).toRgb();return t.r=S(0,_(255,t.r-o(255*-(r/100)))),t.g=S(0,_(255,t.g-o(255*-(r/100)))),t.b=S(0,_(255,t.b-o(255*-(r/100)))),u(t)}function Se(e,r){r=r===0?0:r||10;var t=u(e).toHsl();return t.l-=r/100,t.l=I(t.l),u(t)}function ke(e,r){var t=u(e).toHsl(),n=(t.h+r)%360;return t.h=n<0?360+n:n,u(t)}function we(e){var r=u(e).toHsl();return r.h=(r.h+180)%360,u(r)}function He(e){var r=u(e).toHsl(),t=r.h;return[u(e),u({h:(t+120)%360,s:r.s,l:r.l}),u({h:(t+240)%360,s:r.s,l:r.l})]}function Re(e){var r=u(e).toHsl(),t=r.h;return[u(e),u({h:(t+90)%360,s:r.s,l:r.l}),u({h:(t+180)%360,s:r.s,l:r.l}),u({h:(t+270)%360,s:r.s,l:r.l})]}function Fe(e){var r=u(e).toHsl(),t=r.h;return[u(e),u({h:(t+72)%360,s:r.s,l:r.l}),u({h:(t+216)%360,s:r.s,l:r.l})]}function Te(e,r,t){r=r||6,t=t||30;var n=u(e).toHsl(),f=360/t,s=[u(e)];for(n.h=(n.h-(f*r>>1)+720)%360;--r;)n.h=(n.h+f)%360,s.push(u(n));return s}function Pe(e,r){r=r||6;for(var t=u(e).toHsv(),n=t.h,f=t.s,s=t.v,g=[],b=1/r;r--;)g.push(u({h:n,s:f,v:s})),s=(s+b)%1;return g}u.mix=function(e,r,t){t=t===0?0:t||50;var n=u(e).toRgb(),f=u(r).toRgb(),s=t/100,g={r:(f.r-n.r)*s+n.r,g:(f.g-n.g)*s+n.g,b:(f.b-n.b)*s+n.b,a:(f.a-n.a)*s+n.a};return u(g)},u.readability=function(e,r){var t=u(e),n=u(r);return(a.max(t.getLuminance(),n.getLuminance())+.05)/(a.min(t.getLuminance(),n.getLuminance())+.05)},u.isReadable=function(e,r,t){var n=u.readability(e,r),f,s;switch(s=!1,f=Oe(t),f.level+f.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s},u.mostReadable=function(e,r,t){var n=null,f=0,s,g,b,v;t=t||{},g=t.includeFallbackColors,b=t.level,v=t.size;for(var m=0;m<r.length;m++)s=u.readability(e,r[m]),s>f&&(f=s,n=u(r[m]));return u.isReadable(e,n,{level:b,size:v})||!g?n:(t.includeFallbackColors=!1,u.mostReadable(e,["#fff","#000"],t))};var O=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Me=u.hexNames=$e(O);function $e(e){var r={};for(var t in e)e.hasOwnProperty(t)&&(r[e[t]]=t);return r}function Q(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function d(e,r){Ie(e)&&(e="100%");var t=Ce(e);return e=_(r,S(0,parseFloat(e))),t&&(e=parseInt(e*r,10)/100),a.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function I(e){return _(1,S(0,e))}function p(e){return parseInt(e,16)}function Ie(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Ce(e){return typeof e=="string"&&e.indexOf("%")!=-1}function x(e){return e.length==1?"0"+e:""+e}function T(e){return e<=1&&(e=e*100+"%"),e}function Y(e){return a.round(parseFloat(e)*255).toString(16)}function K(e){return p(e)/255}var y=function(){var e="[-\\+]?\\d+%?",r="[-\\+]?\\d*\\.\\d+%?",t="(?:"+r+")|(?:"+e+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",f="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+f),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+f),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+f),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function k(e){return!!y.CSS_UNIT.exec(e)}function Ee(e){e=e.replace(l,"").replace(h,"").toLowerCase();var r=!1;if(O[e])e=O[e],r=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=y.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=y.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=y.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=y.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=y.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=y.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=y.hex8.exec(e))?{r:p(t[1]),g:p(t[2]),b:p(t[3]),a:K(t[4]),format:r?"name":"hex8"}:(t=y.hex6.exec(e))?{r:p(t[1]),g:p(t[2]),b:p(t[3]),format:r?"name":"hex"}:(t=y.hex4.exec(e))?{r:p(t[1]+""+t[1]),g:p(t[2]+""+t[2]),b:p(t[3]+""+t[3]),a:K(t[4]+""+t[4]),format:r?"name":"hex8"}:(t=y.hex3.exec(e))?{r:p(t[1]+""+t[1]),g:p(t[2]+""+t[2]),b:p(t[3]+""+t[3]),format:r?"name":"hex"}:!1}function Oe(e){var r,t;return e=e||{level:"AA",size:"small"},r=(e.level||"AA").toUpperCase(),t=(e.size||"small").toLowerCase(),r!=="AA"&&r!=="AAA"&&(r="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:r,size:t}}i.exports?i.exports=u:window.tinycolor=u})(Math)})(L);const M=L.exports,$=2,B=5,ie=4,se=.16,fe=.05,ue=.05,he=.15,z=(i,a,l)=>{let h;return Math.round(i.h)>=60&&Math.round(i.h)<=240?h=l?Math.round(i.h)-$*a:Math.round(i.h)+$*a:h=l?Math.round(i.h)+$*a:Math.round(i.h)-$*a,(h<0||h>=360)&&(h=Math.abs(Math.abs(h)-360)),h},j=(i,a,l)=>{if(i.h===0&&i.s===0)return i.s;let h=l?i.s-se*a:i.s+fe*a;return h>1&&(h=1),h<.06&&(h=.06),l&&a===B&&h>.1&&(h=.1),Number(h.toFixed(2))},D=(i,a,l)=>{let h;return h=l?i.v+ue*a:i.v-he*a,h>1&&(h=1),Number(h.toFixed(2))},oe=i=>{const a=[],l=M(i),h=l.toHsv();for(let c=B;c>0;c-=1){const o=M({h:z(h,c,!0),s:j(h,c,!0),v:D(h,c,!0)}).toHexString();a.push(o)}a.push(i);for(let c=1;c<=ie;c+=1){const o=M({h:z(h,c),s:j(h,c),v:D(h,c)}).toHexString();a.push(o)}return{DEFAULT:l.toHexString(),50:a[0],100:a[1],200:a[2],300:a[3],400:a[4],500:l.toHexString(),600:a[6],700:a[7],800:a[8],900:a[9]}};function U(i){const a=i.replace(/##/g,"#"),l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);if(!l)return null;const[,h,c,o]=l;return{r:parseInt(h,16),g:parseInt(c,16),b:parseInt(o,16)}}function V(i,a,l){const h=c=>`0${c.toString(16)}`.slice(-2);return`#${h(i)}${h(a)}${h(l)}`}const R=(i,a)=>{const l=U(`#${i}`);if(!l)return"";const h=Math.round(l.r+(255-l.r)*a),c=Math.round(l.g+(255-l.g)*a),o=Math.round(l.b+(255-l.b)*a);return V(h,c,o)},F=(i,a)=>{const l=U(i);if(!l)return"";const h=Math.round(l.r*a),c=Math.round(l.g*a),o=Math.round(l.b*a);return V(h,c,o)},G=i=>{i=M(i).toHexString();const a={50:.9,100:.8,200:.6,300:.4,400:.2,600:.8,700:.6,800:.4,900:.2,950:.1};return{DEFAULT:i,50:R(i,a[50]),100:R(i,a[100]),200:R(i,a[200]),300:R(i,a[300]),400:R(i,a[400]),500:i,600:F(i,a[600]),700:F(i,a[700]),800:F(i,a[800]),900:F(i,a[900]),950:F(i,a[950])}},le=(i,a,l)=>{let h;return l==="antd"?h=oe(a):h=G(a),h},ce=(i,a)=>{const l=Object.keys(i).map(c=>({name:c,value:i[c]})),h={};return l.forEach(c=>{const o=le(c.name,c.value,a);h[c.name]=o}),h},q=(i,a="")=>Object.keys(i).reduce((l,h)=>{const c=i[h],o=h==="DEFAULT"?{[`--color${a}`]:c}:{[`--color${a}-${h}`]:c},_=typeof c=="string"?o:q(c,`-${h}`);return{...l,..._}},{});return{paletteCssVariablesPlugin:ae.withOptions(function(i){return function({addBase:a,theme:l}){a({":root":q(l("colors"))})}},function(i){const a=ce(i==null?void 0:i.colors,i==null?void 0:i.algo);return{content:[],theme:{extend:{colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...a}}}}}),generatePalette:G}});