Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colortranslator

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colortranslator - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

2

esm/index.js

@@ -1,1 +0,1 @@

var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}var r,n,i,o;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(r||(r={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(n||(n={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(i||(i={})),function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(o||(o={}));var a,u,c,s,d,h,l,f=Object.keys(o),g={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},p={BGR:r.RGB,ABGR:r.RGB,HLS:r.HSL,AHLS:r.HSL,CKMY:r.CMYK,ACKMY:r.CMYK},b=((a={})[r.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,a[r.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a[r.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a[r.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a),F=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,m=/^(\d+(?:\.\d+)?|\.\d+)%$/,y=/^0x([a-f\d]{1,2})$/i,A=/\{(\d+)\}/g,E="The provided string color doesn't have a correct format",v="The provided color object doesn't have the proper keys or format",H=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},B=function(t){return+"".concat(t).replace(m,"$1")},C=function(t){return m.test("".concat(t))?B(t):Math.min(+t,100)},M=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},R=function(t){var e=G(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},D=function(t,e){return void 0===e&&(e=!1),!e&&m.test(t)?Math.min(255*B(t)/100,255):y.test(t)?(3===t.length&&(t+=t.slice(-1)),e?G(t)/255:G(t)):Math.min(+t,e?1:255)},S=function(t){return Math.min(m.test(t)?B(t)/100:+t,1)},L=function(t){return e([],t,!0).sort().join("").toUpperCase()},G=function(t,e){void 0===e&&(e=6);var r=Math.pow(10,e);return Math.round(+t*r)/r},k=function(t,e,r){return Math.max(e,Math.min(t,r))},O=function(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),G(r<1?255*((e-t)*r+t):r<3?255*e:r<4?255*((e-t)*(4-r)+t):255*t)},X=function(t,e,r){e/=100;var n=(r/=100)<=.5?r*(e+1):r+e-r*e,i=2*r-n;return{r:O(i,n,(t/=60)+2),g:O(i,n,t),b:O(i,n,t-2)}},Y=function(t,e,r,n){return{r:G(255*(1-t)*(n=1-n)),g:G(255*(1-e)*n),b:G(255*(1-r)*n)}},j=function(t,e,r){t/=255,e/=255,r/=255;var n=1-Math.max(t,e,r),i=1-n,o=i&&(i-e)/i,a=i&&(i-r)/i;return{c:G(100*(i&&(i-t)/i)),m:G(100*o),y:G(100*a),k:G(100*n)}},K=function(t,e,r,n){void 0===n&&(n=1),t/=255,e/=255,r/=255,n=Math.min(n,1);var i=Math.max(t,e,r),o=Math.min(t,e,r),a=i-o,u=0,c=0,s=(i+o)/2;if(0!==a){switch(i){case t:u=(e-r)/a%6;break;case e:u=(r-t)/a+2;break;case r:u=(t-e)/a+4}(u=G(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:G(100*c),l:G(100*s),a:n}},I=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var r=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],i=e?n:r,o=0,a=0,u=0,c=0;return(e?r:n).find((function(e,r){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],u=i[r][0],c=i[r][1],!0)})),u+(c-u)/(a-o)*(t-o)},P=function(t,e){void 0===e&&(e=!1);var r=L(Object.keys(t));return g[p[r]].reduce((function(r,n){var i,o,a=t[n];return void 0!==a&&(e?r.push((i=G(a,0),1===(o=G(i,0).toString(16).toUpperCase()).length&&(o="0".concat(o)),o)):r.push(a)),r}),[])},T=function(t,e){return t.replace(A,(function(t,r){return"".concat(e[+r-1])}))},w=((u={})[r.HEX]=function(t){var e=P(t,!0),r=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return T(r,e)},u[r.RGB]=function(t){var e=P(t),r=4===e.length?"rgba({1},{2},{3},{4})":"rgb({1},{2},{3})";return T(r,e)},u[r.HSL]=function(t){var e=P(t),r=4===e.length?"hsla({1},{2}%,{3}%,{4})":"hsl({1},{2}%,{3}%)";return T(r,e)},u[r.CMYK]=function(t){var e=P(t),r=5===e.length?"cmyk({1}%,{2}%,{3}%,{4}%,{5})":"cmyk({1}%,{2}%,{3}%,{4}%)";return T(r,e)},u),x=function(t){if("string"==typeof t){var e=t.match(F),r=+e[1];switch(e[2]){case"rad":t=G(180*r/Math.PI);break;case"turn":t=G(360*r);break;default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},N=function(t){return"string"==typeof t&&(t=m.test(t)?B(t)/100:+t),isNaN(+t)||t>1?1:G(t)},V=function(r,n,o){return n.reduce((function(n,a){return e(e([],n,!0),[t(t({},r),{h:o===i.ADDITIVE?x(r.h+a):x(I(I(r.h,!1)+a,!0))})],!1)}),[t({},r)])},U=function(t,e){return V(t,[30,-30],e)},q=function(t,e){return V(t,[180],e)},$=function(t,e){return V(t,[150,-150],e)},_=function(t,e){return V(t,[120,-120],e)},Q=function(t,e){return V(t,[60,-120,180],e)},z=function(t,e){return V(t,[90,-90,180],e)},J=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(r).some((function(r){if(b[r].test(t))return e=r,!0})),!e&&~f.indexOf(t)&&(e=r.HEX),!e)throw new Error(E);return e}(t):function(t){var e,n=!1,i=L(Object.keys(t));if(p[i]&&(e=p[i]),e&&e===r.RGB){var o=Object.entries(t).some((function(t){return!y.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(m.test("".concat(t[1]))||!y.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(n=!0),o||(e=r.HEX)}if(!e||n)throw new Error(v);return e}(t)},W=((c={})[r.HEX]=function(t){var e=(~f.indexOf(t)?o[t]:t).match(b.HEX),r={r:M(e[1]||e[5]),g:M(e[2]||e[6]),b:M(e[3]||e[7])},n=e[4]||e[8];return void 0!==n&&(r.a=M(n)/255),r},c[r.RGB]=function(t){var e=t.match(b.RGB),r=D(e[1]||e[5]),n=D(e[2]||e[6]),i=D(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(r,255),g:Math.min(n,255),b:Math.min(i,255)};return void 0!==o&&(a.a=N(o)),a},c[r.HSL]=function(t){var e=t.match(b.HSL),r=x(e[1]||e[5]),n=C(e[2]||e[6]),i=C(e[3]||e[7]),o=e[4]||e[8],a=X(r,n,i);return void 0!==o&&(a.a=N(o)),a},c[r.CMYK]=function(t){var e=t.match(b.CMYK),r=S(e[1]||e[6]),n=S(e[2]||e[7]),i=S(e[3]||e[8]),o=S(e[4]||e[9]),a=e[5]||e[10],u=Y(r,n,i,o);return void 0!==a&&(u.a=N(a)),u},c),Z=((s={})[r.HEX]=function(t){var e={r:D("".concat(t.r)),g:D("".concat(t.g)),b:D("".concat(t.b))};return H(t,"a")&&(e.a=Math.min(D("".concat(t.a),!0),1)),e},s[r.RGB]=function(t){return this.HEX(t)},s[r.HSL]=function(t){var e=C("".concat(t.s)),r=C("".concat(t.l)),n=X(x(t.h),e,r);return H(t,"a")&&(n.a=N(t.a)),n},s[r.CMYK]=function(t){var e=S("".concat(t.c)),r=S("".concat(t.m)),n=S("".concat(t.y)),i=S("".concat(t.k)),o=Y(e,r,n,i);return H(t,"a")&&(o.a=N(t.a)),o},s),tt=function(t,e){return void 0===e&&(e=J(t)),"string"==typeof t?W[e](t):Z[e](t)},et=((d={})[r.HEX]=function(t){return{r:R(t.r),g:R(t.g),b:R(t.b)}},d.HEXA=function(t){var e=et.HEX(t);return e.a=H(t,"a")?R(255*t.a):"0xFF",e},d[r.RGB]=function(t,e){return H(t,"a")&&delete t.a,ot(t,e)},d.RGBA=function(t,e){return t.a=H(t,"a")?G(t.a):1,ot(t,e)},d[r.HSL]=function(t,e){var r=K(t.r,t.g,t.b);return delete r.a,at(r,e)},d.HSLA=function(t,e){var r=et.HSL(t,e);return r.a=H(t,"a")?G(t.a,e):1,r},d[r.CMYK]=function(t,e){return ut(j(t.r,t.g,t.b),e)},d.CMYKA=function(t,e){var r=et.CMYK(t,e);return r.a=H(t,"a")?G(t.a,e):1,r},d),rt=function(e,n,i,o){var a=J(e),u="string"==typeof e,c=tt(e,a),s="string"==typeof e&&H(c,"a")||"string"!=typeof e&&H(e,"a"),d=K(c.r,c.g,c.b,c.a);s||delete d.a;var h=i?d.l/(n+1):(100-d.l)/(n+1),l=Array(n).fill(null).map((function(e,r){return t(t({},d),{l:d.l+h*(r+1)*(1-2*+i)})}));switch(a){case r.HEX:default:return l.map((function(e){var r=X(e.h,e.s,e.l);return s&&(r.a=e.a),u?s?w.HEX(ot(t(t({},r),{a:G(255*r.a)}),o)):w.HEX(ot(r,o)):s?et.HEXA(r):et.HEX(r)}));case r.RGB:return l.map((function(t){var e=X(t.h,t.s,t.l);return s&&(e.a=t.a),u?w.RGB(ot(e,o)):s?et.RGBA(e,o):et.RGB(e,o)}));case r.HSL:return l.map((function(e){return u?w.HSL(at(e,o)):s?et.HSLA(t(t({},X(e.h,e.s,e.l)),{a:e.a}),o):et.HSL(X(e.h,e.s,e.l),o)}))}},nt=((h={buildHarmony:function(t,e,n,i){var o=J(t),a=tt(t,o),u=K(a.r,a.g,a.b,a.a),c="string"==typeof t&&H(a,"a")||"string"!=typeof t&&H(t,"a"),s="string"==typeof t;switch(o){case r.HEX:default:return c?this.HEXA(at(u,0),e,n,s):this.HEX(at(u,0),e,n,s);case r.HSL:return c?this.HSLA(u,e,n,s,i):this.HSL(u,e,n,s,i);case r.RGB:return c?this.RGBA(u,e,n,s,i):this.RGB(u,e,n,s,i)}}})[r.HEX]=function(t,e,r,n){return e(t,r).map((function(t){return n?w.HEX(X(t.h,t.s,t.l)):et.HEX(X(t.h,t.s,t.l))}))},h.HEXA=function(e,r,n,i){return r(e,n).map((function(e){return i?w.HEX(t(t({},X(e.h,e.s,e.l)),{a:255*N(e.a)})):et.HEXA(t(t({},X(e.h,e.s,e.l)),{a:N(e.a)}))}))},h[r.RGB]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?w.RGB(ot(X(t.h,t.s,t.l),i)):et.RGB(X(t.h,t.s,t.l),i)}))},h.RGBA=function(e,r,n,i,o){return r(e,n).map((function(e){return i?w.RGB(ot(t(t({},X(e.h,e.s,e.l)),{a:N(e.a)}),o)):et.RGBA(t(t({},X(e.h,e.s,e.l)),{a:N(e.a)}),o)}))},h[r.HSL]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?w.HSL(at({h:t.h,s:t.s,l:t.l},i)):et.HSL(X(t.h,t.s,t.l),i)}))},h.HSLA=function(e,r,n,i,o){return r(e,n).map((function(e){return i?w.HSL(at(t(t({},e),{a:N(e.a)}),o)):et.HSLA(t(t({},X(e.h,e.s,e.l)),{a:N(e.a)}),o)}))},h),it=((l={mix:function(e,r){var n,o,a,u,c,s,d,h,l,f,g,p,b,F,m,y=e.map((function(t){var e=J(t);return tt(t,e)})),A=r===i.SUBTRACTIVE?y.map((function(t){var e,r,n,i,o,a,u,c,s,d,h,l,f,g,p=(e=t.r,r=t.g,n=t.b,i=Math.min(e,r,n),o=Math.min(255-e,255-r,255-n),a=e-i,u=r-i,c=n-i,s=Math.min(a,u),d=a-s,h=(u+s)/2,l=(c+u-s)/2,f=Math.max(d,h,l)/Math.max(a,u,c),g=isNaN(f)||f===1/0||f<=0?1:f,{r:d/g+o,y:h/g+o,b:l/g+o});return H(t,"a")&&(p.a=t.a),p})):null;function E(e){var n=r===i.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return e.reduce((function(e,n){var o=H(n,"a")?n.a:1,a={r:Math.min(e.r+n.r*o,255),b:Math.min(e.b+n.b*o,255),a:1-(1-o)*(1-e.a)},u="g"in e?e.g:e.y,c="g"in n?n.g:n.y;return t(t({},a),r===i.ADDITIVE?{g:Math.min(u+c*o,255)}:{y:Math.min(u+c*o,255)})}),n)}if(r===i.ADDITIVE)n=E(y);else{var v=E(A);o=v.r,a=v.y,u=v.b,c=Math.min(o,a,u),s=Math.min(255-o,255-a,255-u),d=o-c,h=a-c,l=u-c,f=Math.min(h,l),g=d+h-f,p=h+f,b=2*(l-f),F=Math.max(g,p,b)/Math.max(d,h,l),m=isNaN(F)||F===1/0||F<=0?1:F,(n={r:g/m+s,g:p/m+s,b:b/m+s}).a=v.a}return{r:G(n.r),g:G(n.g),b:G(n.b),a:k(n.a,0,1)}}})[r.HEX]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?w.HEX(n):et.HEX(n)},l.HEXA=function(t,e,r){var n=this.mix(t,e);return n.a=r?255*N(n.a):N(n.a),r?w.HEX(n):et.HEXA(n)},l[r.RGB]=function(t,e,r,n){var i=this.mix(t,e);return delete i.a,r?w.RGB(i):et.RGB(i,n)},l.RGBA=function(t,e,r,n){var i=this.mix(t,e);return r?w.RGB(i):et.RGBA(i,n)},l[r.HSL]=function(t,e,r,n){var i=this.mix(t,e),o=K(i.r,i.g,i.b);return delete i.a,delete o.a,r?w.HSL(o):et.HSL(i,n)},l.HSLA=function(t,e,r,n){var i=this.mix(t,e),o=K(i.r,i.g,i.b,i.a);return r?w.HSL(o):et.HSLA(i,n)},l),ot=function(e,r){return t({r:G(e.r,r),g:G(e.g,r),b:G(e.b,r)},H(e,"a")?{a:G(e.a,r)}:{})},at=function(e,r){return t({h:G(e.h,r),s:G(e.s,r),l:G(e.l,r)},H(e,"a")?{a:G(e.a,r)}:{})},ut=function(t,e){return{c:G(t.c,e),m:G(t.m,e),y:G(t.y,e),k:G(t.k,e)}},ct=function(t,e,r,n,i,o){var a=i(tt(t,e),n);return r?o(a):a},st=function(t,e,r,n,i,o,a){r<1&&(r=5);var u=function(t,e,r){var n=r-1,i=(e.r-t.r)/n,o=(e.g-t.g)/n,a=(e.b-t.b)/n,u=N(t.a),c=(N(e.a)-u)/n;return Array(r).fill(null).map((function(r,s){return 0===s?t:s===n?e:{r:G(t.r+i*s),g:G(t.g+o*s),b:G(t.b+a*s),a:G(u+c*s)}}))}(tt(t),tt(e),r);return u.map((function(t){var e=o(t,i);return n?a(e):e}))},dt=function(){function e(t,e){void 0===e&&(e=6),this.rgb=tt(t),this._decimals=e,this.updateHSL(),this.updateCMYK()}return e.prototype.updateRGB=function(){this.rgb=t(t({},X(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},e.prototype.updateRGBFromCMYK=function(){this.rgb=t(t({},Y(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},e.prototype.updateHSL=function(){this.hsl=K(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},e.prototype.updateCMYK=function(){this.cmyk=j(this.rgb.r,this.rgb.g,this.rgb.b)},e.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},e.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},e.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},e.prototype.setDecimals=function(t){return this._decimals=t,this},e.prototype.setH=function(t){return this.hsl.h=x(t),this.updateRGBAndCMYK()},e.prototype.setS=function(t){return this.hsl.s=k(t,0,100),this.updateRGBAndCMYK()},e.prototype.setL=function(t){return this.hsl.l=k(t,0,100),this.updateRGBAndCMYK()},e.prototype.setR=function(t){return this.rgb.r=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setG=function(t){return this.rgb.g=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setB=function(t){return this.rgb.b=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setA=function(t){return this.hsl.a=this.rgb.a=k(t,0,1),this},e.prototype.setC=function(t){return this.cmyk.c=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setM=function(t){return this.cmyk.m=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setY=function(t){return this.cmyk.y=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setK=function(t){return this.cmyk.k=k(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(e.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H",{get:function(){return G(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"S",{get:function(){return G(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"L",{get:function(){return G(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"R",{get:function(){return G(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"G",{get:function(){return G(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return G(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"A",{get:function(){return G(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"C",{get:function(){return G(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"M",{get:function(){return G(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Y",{get:function(){return G(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"K",{get:function(){return G(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXObject",{get:function(){return et.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXAObject",{get:function(){return et.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBAObject",{get:function(){return t(t({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLAObject",{get:function(){return t(t({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKAObject",{get:function(){return t(t({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEX",{get:function(){return w.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXA",{get:function(){return w.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGB",{get:function(){return w.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBA",{get:function(){return w.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSL",{get:function(){return w.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLA",{get:function(){return w.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYK",{get:function(){return w.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKA",{get:function(){return w.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),e.toHEX=function(t,e){void 0===e&&(e=!0);var r=J(t);return ct(t,r,e,0,et.HEX,w.HEX)},e.toHEXA=function(t,e){void 0===e&&(e=!0);var r=J(t);return ct(t,r,e,0,et.HEXA,w.HEX)},e.toRGB=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.RGB,w.RGB)},e.toRGBA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.RGBA,w.RGB)},e.toHSL=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.HSL,w.HSL)},e.toHSLA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.HSLA,w.HSL)},e.toCMYK=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.CMYK,w.CMYK)},e.toCMYKA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return ct(t,n,e,r,et.CMYKA,w.CMYK)},e.getBlendHEX=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.HEX,w.HEX)},e.getBlendHEXA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.HEXA,w.HEX)},e.getBlendRGB=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.RGB,w.RGB)},e.getBlendRGBA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.RGBA,w.RGB)},e.getBlendHSL=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.HSL,w.HSL)},e.getBlendHSLA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),st(t,e,r,n,i,et.HSLA,w.HSL)},e.getMixHEX=function(t,e,r){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),it.HEX(t,e,r)},e.getMixHEXA=function(t,e,r){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),it.HEXA(t,e,r)},e.getMixRGB=function(t,e,r,n){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.RGB(t,e,r,n)},e.getMixRGBA=function(t,e,r,n){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.RGBA(t,e,r,n)},e.getMixHSL=function(t,e,r,n){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.HSL(t,e,r,n)},e.getMixHSLA=function(t,e,r,n){return void 0===e&&(e=i.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.HSLA(t,e,r,n)},e.getShades=function(t,e,r){return void 0===r&&(r=6),rt(t,e,!0,r)},e.getTints=function(t,e,r){return void 0===r&&(r=6),rt(t,e,!1,r)},e.getHarmony=function(t,e,r,o){return void 0===e&&(e=n.COMPLEMENTARY),void 0===r&&(r=i.ADDITIVE),void 0===o&&(o=6),function(t,e,r,i){var o;return(o={},o[n.ANALOGOUS]=nt.buildHarmony(e,U,i,r),o[n.COMPLEMENTARY]=nt.buildHarmony(e,q,i,r),o[n.SPLIT_COMPLEMENTARY]=nt.buildHarmony(e,$,i,r),o[n.TRIADIC]=nt.buildHarmony(e,_,i,r),o[n.TETRADIC]=nt.buildHarmony(e,Q,i,r),o[n.SQUARE]=nt.buildHarmony(e,z,i,r),o)[t]}(e,t,o,r)},e}();export{dt as ColorTranslator,n as Harmony,i as Mix};
var t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var n,r,i,o;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(n||(n={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(r||(r={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(i||(i={})),function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(o||(o={}));var a,c,u=Object.keys(o),s={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},d={BGR:n.RGB,ABGR:n.RGB,HLS:n.HSL,AHLS:n.HSL,CKMY:n.CMYK,ACKMY:n.CMYK};!function(t){t.NUMBER="number",t.BOOLEAN="boolean"}(a||(a={}));var l,f,h,p=((c={})[n.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,c[n.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c[n.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c[n.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c),g=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,m=/^0x([a-f\d]{1,2})$/i,A=/\{(\d+)\}/g,y=/,( +|\d+)/g,E=/ +/,F="The provided string color doesn't have a correct format",v="The provided color object doesn't have the proper keys or format";!function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"}(l||(l={})),function(t){t.NONE="none",t.PERCENT="percent"}(f||(f={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(h||(h={}));var H,B,C,S,R,M,D={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:l.NONE,rgbUnit:f.NONE,cmykUnit:f.PERCENT,alphaUnit:f.NONE,cmykFunction:h.DEVICE_CMYK},O=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},L=function(t){return+"".concat(t).replace(b,"$1")},G=function(t){return b.test("".concat(t))?L(t):Math.min(+t,100)},k=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},j=function(t){var e=K(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},X=function(t,e){return void 0===e&&(e=!1),!e&&b.test(t)?Math.min(255*L(t)/100,255):m.test(t)?(3===t.length&&(t+=t.slice(-1)),e?K(t)/255:K(t)):Math.min(+t,e?1:255)},I=function(t){return Math.min(b.test(t)?L(t)/100:+t,1)},Y=function(t){return e([],t,!0).sort().join("").toUpperCase()},K=function(t,e){void 0===e&&(e=6);var n=Math.pow(10,e);return Math.round(+t*n)/n},N=function(t,e,n){return Math.max(e,Math.min(t,n))},T=function(t){if("string"==typeof t){var e=t.match(g),n=+e[1];switch(e[2]){case l.RADIANS:t=K(180*n/Math.PI);break;case l.TURNS:t=K(360*n);break;case l.GRADIANS:t=K(.9*n);break;case l.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},P=function(t,e){var n;switch(e){case l.RADIANS:n=K(function(t){return t*Math.PI/180}(t));break;case l.TURNS:n=K(t/360);break;case l.GRADIANS:n=K(10/9*t);break;case l.DEGREES:case l.NONE:default:n=t}return n},U=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=[],i=[],o=[],c=[],u=[],s=Object.values(l),d=Object.values(f),m=Object.values(h),A={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0},F=0,v=e;F<v.length;F++){var H=v[F];if("string"==typeof H){if(r.push(H),H.includes(",")){A.legacyCSS++;var B=H.match(y);1===new Set(B).size&&E.test(B[0].slice(1))&&A.spacesAfterCommas++}if(H.match(p.HSL)){var C=(k=H.match(p.HSL))[1]||k[5],S=k[8],R=C.match(g)[2];i.push(""===R?l.NONE:R),u.push(b.test(S));continue}if(p.RGB.test(H)){var M=(k=H.match(p.RGB))[1]||k[5],O=k[2]||k[6],L=k[3]||k[7],G=k[8];o.push(b.test(M)&&b.test(O)&&b.test(L)),u.push(b.test(G));continue}if(H.match(p.CMYK)){var k,j=(k=H.match(p.CMYK))[1]||k[6],X=k[2]||k[7],I=k[3]||k[8],Y=k[4]||k[9];G=k[10];c.push(b.test(j)&&b.test(X)&&b.test(I)&&b.test(Y)),H.startsWith("cmyk")&&A.cmykFunction++,u.push(b.test(G))}}}return{decimals:typeof t.decimals===a.NUMBER?t.decimals:D.decimals,legacyCSS:typeof t.legacyCSS===a.BOOLEAN?t.legacyCSS:Boolean(r.length&&A.legacyCSS===r.length)||D.legacyCSS,spacesAfterCommas:typeof t.spacesAfterCommas===a.BOOLEAN?t.spacesAfterCommas:Boolean(r.length&&A.spacesAfterCommas===r.length)||D.spacesAfterCommas,anglesUnit:t.anglesUnit&&s.includes(t.anglesUnit)?t.anglesUnit:1===new Set(i).size?i[0]:D.anglesUnit,rgbUnit:t.rgbUnit&&d.includes(t.rgbUnit)?t.rgbUnit:1===new Set(o).size&&o[0]?f.PERCENT:D.rgbUnit,cmykUnit:t.cmykUnit&&d.includes(t.cmykUnit)?t.cmykUnit:1!==new Set(c).size||c[0]?D.cmykUnit:f.NONE,alphaUnit:t.alphaUnit&&d.includes(t.alphaUnit)?t.alphaUnit:1===new Set(u).size&&u[0]?f.PERCENT:D.alphaUnit,cmykFunction:t.cmykFunction&&m.includes(t.cmykFunction)?t.cmykFunction:c.length&&c.length===A.cmykFunction?h.CMYK:D.cmykFunction}},w=function(t,e,n){return n<0&&(n+=6),n>=6&&(n-=6),K(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)},x=function(t,e,n){e/=100;var r=(n/=100)<=.5?n*(e+1):n+e-n*e,i=2*n-r;return{r:w(i,r,(t/=60)+2),g:w(i,r,t),b:w(i,r,t-2)}},V=function(t,e,n,r){return{r:K(255*(1-t)*(r=1-r)),g:K(255*(1-e)*r),b:K(255*(1-n)*r)}},q=function(t,e,n){t/=255,e/=255,n/=255;var r=1-Math.max(t,e,n),i=1-r,o=i&&(i-e)/i,a=i&&(i-n)/i;return{c:K(100*(i&&(i-t)/i)),m:K(100*o),y:K(100*a),k:K(100*r)}},_=function(t,e,n,r){void 0===r&&(r=1),t/=255,e/=255,n/=255,r=Math.min(r,1);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=i-o,c=0,u=0,s=(i+o)/2;if(0!==a){switch(i){case t:c=(e-n)/a%6;break;case e:c=(n-t)/a+2;break;case n:c=(t-e)/a+4}(c=K(60*c))<0&&(c+=360),u=a/(1-Math.abs(2*s-1))}return{h:c,s:K(100*u),l:K(100*s),a:r}},$=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var n=[[0,120],[120,180],[180,240],[240,360]],r=[[0,60],[60,120],[120,240],[240,360]],i=e?r:n,o=0,a=0,c=0,u=0;return(e?n:r).find((function(e,n){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],c=i[n][0],u=i[n][1],!0)})),c+(u-c)/(a-o)*(t-o)},z=function(t){return t?", ":","},Q=function(t,e){var n=Y(Object.keys(t));return s[d[n]].reduce((function(n,r,i){var o=t[r];return void 0!==o&&n.push(e(o,i)),n}),[])},W=function(t,e){return t.replace(A,(function(t,n){return"".concat(e[+n-1])}))},J=function(t,e){var n=e.alphaUnit,r=e.legacyCSS,i=e.decimals;return n!==f.PERCENT||r?K(t,i):"".concat(K(100*t,i),"%")},Z=((H={})[n.HEX]=function(t){var e=Q(t,(function(t){return e=K(t),1===(n=K(e,0).toString(16).toUpperCase()).length&&(n="0".concat(n)),n;var e,n})),n=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return W(n,e)},H[n.RGB]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.rgbUnit,a=z(i),c=Q(t,(function(t,r){return o===f.PERCENT&&r<3?"".concat(function(t,e){return K(t/255*100,e)}(t,n),"%"):3===r?J(t,e):K(t,n)})),u=r?4===c.length?"rgba({1}".concat(a,"{2}").concat(a,"{3}").concat(a,"{4})"):"rgb({1}".concat(a,"{2}").concat(a,"{3})"):4===c.length?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return W(u,c)},H[n.HSL]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.anglesUnit,a=z(i),c=Q(t,(function(t,r){if(0===r&&o!==l.NONE){var i=K(P(t,o),n);return"".concat(i).concat(o)}return 3===r?J(t,e):K(t,n)})),u=r?4===c.length?"hsla({1}".concat(a,"{2}%").concat(a,"{3}%").concat(a,"{4})"):"hsl({1}".concat(a,"{2}%").concat(a,"{3}%)"):4===c.length?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return W(u,c)},H[n.CMYK]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.cmykUnit,a=e.cmykFunction,c=z(i),u=Q(t,(function(t,r){return o===f.PERCENT&&r<4?"".concat(K(t,n),"%"):4===r?J(t,e):K(t/100,n)})),s=r?5===u.length?"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4}").concat(c,"{5})"):"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4})"):5===u.length?"".concat(a,"({1} {2} {3} {4} / {5})"):"".concat(a,"({1} {2} {3} {4})");return W(s,u)},H),tt=function(t){return"string"==typeof t&&(t=b.test(t)?L(t)/100:+t),isNaN(+t)||t>1?1:K(t)},et=function(n,r,o){return r.reduce((function(r,a){return e(e([],r,!0),[t(t({},n),{h:o===i.ADDITIVE?T(n.h+a):T($($(n.h,!1)+a,!0))})],!1)}),[t({},n)])},nt=function(t,e){return et(t,[30,-30],e)},rt=function(t,e){return et(t,[180],e)},it=function(t,e){return et(t,[150,-150],e)},ot=function(t,e){return et(t,[120,-120],e)},at=function(t,e){return et(t,[60,-120,180],e)},ct=function(t,e){return et(t,[90,-90,180],e)},ut=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(n).some((function(n){if(p[n].test(t))return e=n,!0})),!e&&~u.indexOf(t)&&(e=n.HEX),!e)throw new Error(F);return e}(t):function(t){var e,r=!1,i=Y(Object.keys(t));if(d[i]&&(e=d[i]),e&&e===n.RGB){var o=Object.entries(t).some((function(t){return!m.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(b.test("".concat(t[1]))||!m.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(r=!0),o||(e=n.HEX)}if(!e||r)throw new Error(v);return e}(t)},st=((B={})[n.HEX]=function(t){var e=(~u.indexOf(t)?o[t]:t).match(p.HEX),n={r:k(e[1]||e[5]),g:k(e[2]||e[6]),b:k(e[3]||e[7])},r=e[4]||e[8];return void 0!==r&&(n.a=k(r)/255),n},B[n.RGB]=function(t){var e=t.match(p.RGB),n=X(e[1]||e[5]),r=X(e[2]||e[6]),i=X(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(n,255),g:Math.min(r,255),b:Math.min(i,255)};return void 0!==o&&(a.a=tt(o)),a},B[n.HSL]=function(t){var e=t.match(p.HSL),n=T(e[1]||e[5]),r=G(e[2]||e[6]),i=G(e[3]||e[7]),o=e[4]||e[8],a=x(n,r,i);return void 0!==o&&(a.a=tt(o)),a},B[n.CMYK]=function(t){var e=t.match(p.CMYK),n=I(e[1]||e[6]),r=I(e[2]||e[7]),i=I(e[3]||e[8]),o=I(e[4]||e[9]),a=e[5]||e[10],c=V(n,r,i,o);return void 0!==a&&(c.a=tt(a)),c},B),dt=((C={})[n.HEX]=function(t){var e={r:X("".concat(t.r)),g:X("".concat(t.g)),b:X("".concat(t.b))};return O(t,"a")&&(e.a=Math.min(X("".concat(t.a),!0),1)),e},C[n.RGB]=function(t){return this.HEX(t)},C[n.HSL]=function(t){var e=G("".concat(t.s)),n=G("".concat(t.l)),r=x(T(t.h),e,n);return O(t,"a")&&(r.a=tt(t.a)),r},C[n.CMYK]=function(t){var e=I("".concat(t.c)),n=I("".concat(t.m)),r=I("".concat(t.y)),i=I("".concat(t.k)),o=V(e,n,r,i);return O(t,"a")&&(o.a=tt(t.a)),o},C),lt=function(t,e){return void 0===e&&(e=ut(t)),"string"==typeof t?st[e](t):dt[e](t)},ft=((S={})[n.HEX]=function(t){return{r:j(t.r),g:j(t.g),b:j(t.b)}},S.HEXA=function(t){var e=ft.HEX(t);return e.a=O(t,"a")?j(255*t.a):"0xFF",e},S[n.RGB]=function(t,e){var n=bt(t,e);return O(n,"a")&&delete n.a,n},S.RGBA=function(t,e){var n=ft.RGB(t,e);return n.a=O(t,"a")?K(t.a):1,n},S[n.HSL]=function(t,e){var n=_(t.r,t.g,t.b);return delete n.a,mt(n,e)},S.HSLA=function(t,e){var n=ft.HSL(t,e);return n.a=O(t,"a")?K(t.a,e):1,n},S[n.CMYK]=function(t,e){return At(q(t.r,t.g,t.b),e)},S.CMYKA=function(t,e){var n=ft.CMYK(t,e);return n.a=O(t,"a")?K(t.a,e):1,n},S),ht=function(e,r,i,o){var a=ut(e),c="string"==typeof e,u=lt(e,a),s="string"==typeof e&&O(u,"a")||"string"!=typeof e&&O(e,"a"),d=_(u.r,u.g,u.b,u.a);s||delete d.a;var l=i?d.l/(r+1):(100-d.l)/(r+1),f=Array(r).fill(null).map((function(e,n){return t(t({},d),{l:d.l+l*(n+1)*(1-2*+i)})}));switch(a){case n.HEX:default:return f.map((function(e){var n=x(e.h,e.s,e.l);return s&&(n.a=e.a),c?s?Z.HEX(t(t({},n),{a:K(255*n.a)})):Z.HEX(n):s?ft.HEXA(n):ft.HEX(n)}));case n.RGB:return f.map((function(t){var e=x(t.h,t.s,t.l);return s&&(e.a=t.a),c?Z.RGB(e,o):s?ft.RGBA(e,o.decimals):ft.RGB(e,o.decimals)}));case n.HSL:return f.map((function(e){return c?Z.HSL(e,o):s?ft.HSLA(t(t({},x(e.h,e.s,e.l)),{a:e.a}),o.decimals):ft.HSL(x(e.h,e.s,e.l),o.decimals)}))}},pt=((R={buildHarmony:function(t,e,r,i){var o=ut(t),a=lt(t,o),c=_(a.r,a.g,a.b,a.a),u="string"==typeof t&&O(a,"a")||"string"!=typeof t&&O(t,"a"),s="string"==typeof t;switch(o){case n.HEX:default:return u?this.HEXA(mt(c,0),e,r,s):this.HEX(mt(c,0),e,r,s);case n.HSL:return u?this.HSLA(c,e,r,s,i):this.HSL(c,e,r,s,i);case n.RGB:return u?this.RGBA(c,e,r,s,i):this.RGB(c,e,r,s,i)}}})[n.HEX]=function(t,e,n,r){return e(t,n).map((function(t){return r?Z.HEX(x(t.h,t.s,t.l)):ft.HEX(x(t.h,t.s,t.l))}))},R.HEXA=function(e,n,r,i){return n(e,r).map((function(e){return i?Z.HEX(t(t({},x(e.h,e.s,e.l)),{a:255*tt(e.a)})):ft.HEXA(t(t({},x(e.h,e.s,e.l)),{a:tt(e.a)}))}))},R[n.RGB]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?Z.RGB(x(t.h,t.s,t.l),i):ft.RGB(x(t.h,t.s,t.l),i.decimals)}))},R.RGBA=function(e,n,r,i,o){return n(e,r).map((function(e){return i?Z.RGB(t(t({},x(e.h,e.s,e.l)),{a:tt(e.a)}),o):ft.RGBA(t(t({},x(e.h,e.s,e.l)),{a:tt(e.a)}),o.decimals)}))},R[n.HSL]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?Z.HSL({h:t.h,s:t.s,l:t.l},i):ft.HSL(x(t.h,t.s,t.l),i.decimals)}))},R.HSLA=function(e,n,r,i,o){return n(e,r).map((function(e){return i?Z.HSL(t(t({},e),{a:tt(e.a)}),o):ft.HSLA(t(t({},x(e.h,e.s,e.l)),{a:tt(e.a)}),o.decimals)}))},R),gt=((M={mix:function(e,n){var r,o,a,c,u,s,d,l,f,h,p,g,b,m,A,y=e.map((function(t){var e=ut(t);return lt(t,e)})),E=n===i.SUBTRACTIVE?y.map((function(t){var e,n,r,i,o,a,c,u,s,d,l,f,h,p,g=(e=t.r,n=t.g,r=t.b,i=Math.min(e,n,r),o=Math.min(255-e,255-n,255-r),a=e-i,c=n-i,u=r-i,s=Math.min(a,c),d=a-s,l=(c+s)/2,f=(u+c-s)/2,h=Math.max(d,l,f)/Math.max(a,c,u),p=isNaN(h)||h===1/0||h<=0?1:h,{r:d/p+o,y:l/p+o,b:f/p+o});return O(t,"a")&&(g.a=t.a),g})):null;function F(e){var r=n===i.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return e.reduce((function(e,r){var o=O(r,"a")?r.a:1,a={r:Math.min(e.r+r.r*o,255),b:Math.min(e.b+r.b*o,255),a:1-(1-o)*(1-e.a)},c="g"in e?e.g:e.y,u="g"in r?r.g:r.y;return t(t({},a),n===i.ADDITIVE?{g:Math.min(c+u*o,255)}:{y:Math.min(c+u*o,255)})}),r)}if(n===i.ADDITIVE)r=F(y);else{var v=F(E);o=v.r,a=v.y,c=v.b,u=Math.min(o,a,c),s=Math.min(255-o,255-a,255-c),d=o-u,l=a-u,f=c-u,h=Math.min(l,f),p=d+l-h,g=l+h,b=2*(f-h),m=Math.max(p,g,b)/Math.max(d,l,f),A=isNaN(m)||m===1/0||m<=0?1:m,(r={r:p/A+s,g:g/A+s,b:b/A+s}).a=v.a}return{r:K(r.r),g:K(r.g),b:K(r.b),a:N(r.a,0,1)}}})[n.HEX]=function(t,e,n){var r=this.mix(t,e);return delete r.a,n?Z.HEX(r):ft.HEX(r)},M.HEXA=function(t,e,n){var r=this.mix(t,e);return r.a=n?255*tt(r.a):tt(r.a),n?Z.HEX(r):ft.HEXA(r)},M[n.RGB]=function(t,e,n,r){var i=this.mix(t,e);return delete i.a,n?Z.RGB(i,r):ft.RGB(i,r.decimals)},M.RGBA=function(t,e,n,r){var i=this.mix(t,e);return n?Z.RGB(i,r):ft.RGBA(i,r.decimals)},M[n.HSL]=function(t,e,n,r){var i=this.mix(t,e),o=_(i.r,i.g,i.b);return delete i.a,delete o.a,n?Z.HSL(o,r):ft.HSL(i,r.decimals)},M.HSLA=function(t,e,n,r){var i=this.mix(t,e),o=_(i.r,i.g,i.b,i.a);return n?Z.HSL(o,r):ft.HSLA(i,r.decimals)},M),bt=function(e,n){var r=K(e.r,n),i=K(e.g,n),o=K(e.b,n);return t({r:r,g:i,b:o},O(e,"a")?{a:K(e.a,n)}:{})},mt=function(e,n){return t({h:K(e.h,n),s:K(e.s,n),l:K(e.l,n)},O(e,"a")?{a:K(e.a,n)}:{})},At=function(t,e){return{c:K(t.c,e),m:K(t.m,e),y:K(t.y,e),k:K(t.k,e)}},yt=function(t,e,n,r){return r(lt(t,e),n)},Et=function(t,e,n,r,i){n<1&&(n=5);var o=function(t,e,n){var r=n-1,i=(e.r-t.r)/r,o=(e.g-t.g)/r,a=(e.b-t.b)/r,c=tt(t.a),u=(tt(e.a)-c)/r;return Array(n).fill(null).map((function(n,s){return 0===s?t:s===r?e:{r:K(t.r+i*s),g:K(t.g+o*s),b:K(t.b+a*s),a:K(c+u*s)}}))}(lt(t),lt(e),n);return o.map((function(t){return i(t,r)}))},Ft=function(){function n(t,e){void 0===e&&(e={}),this._options=U(e,t),this.rgb=lt(t),this.updateHSL(),this.updateCMYK()}return n.prototype.updateRGB=function(){this.rgb=t(t({},x(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},n.prototype.updateRGBFromCMYK=function(){this.rgb=t(t({},V(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},n.prototype.updateHSL=function(){this.hsl=_(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},n.prototype.updateCMYK=function(){this.cmyk=q(this.rgb.r,this.rgb.g,this.rgb.b)},n.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},n.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},n.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},n.prototype.setOptions=function(e){return void 0===e&&(e={}),this._options=t(t({},this._options),e),this},n.prototype.setH=function(t){return this.hsl.h=T(t),this.updateRGBAndCMYK()},n.prototype.setS=function(t){return this.hsl.s=N(t,0,100),this.updateRGBAndCMYK()},n.prototype.setL=function(t){return this.hsl.l=N(t,0,100),this.updateRGBAndCMYK()},n.prototype.setR=function(t){return this.rgb.r=N(t,0,255),this.updateHSLAndCMYK()},n.prototype.setG=function(t){return this.rgb.g=N(t,0,255),this.updateHSLAndCMYK()},n.prototype.setB=function(t){return this.rgb.b=N(t,0,255),this.updateHSLAndCMYK()},n.prototype.setA=function(t){return this.hsl.a=this.rgb.a=N(t,0,1),this},n.prototype.setC=function(t){return this.cmyk.c=N(t,0,100),this.updateRGBAndHSL()},n.prototype.setM=function(t){return this.cmyk.m=N(t,0,100),this.updateRGBAndHSL()},n.prototype.setY=function(t){return this.cmyk.y=N(t,0,100),this.updateRGBAndHSL()},n.prototype.setK=function(t){return this.cmyk.k=N(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(n.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"H",{get:function(){return K(this.hsl.h,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"S",{get:function(){return K(this.hsl.s,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"L",{get:function(){return K(this.hsl.l,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"R",{get:function(){return K(this.rgb.r,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"G",{get:function(){return K(this.rgb.g,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"B",{get:function(){return K(this.rgb.b,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"A",{get:function(){return K(this.hsl.a,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"C",{get:function(){return K(this.cmyk.c,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"M",{get:function(){return K(this.cmyk.m,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Y",{get:function(){return K(this.cmyk.y,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"K",{get:function(){return K(this.cmyk.k,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXObject",{get:function(){return ft.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXAObject",{get:function(){return ft.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBAObject",{get:function(){return t(t({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLAObject",{get:function(){return t(t({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKAObject",{get:function(){return t(t({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEX",{get:function(){return Z.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXA",{get:function(){return Z.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGB",{get:function(){return Z.RGB({r:this.R,g:this.G,b:this.B},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBA",{get:function(){return Z.RGB({r:this.R,g:this.G,b:this.B,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSL",{get:function(){return Z.HSL({h:this.H,s:this.S,l:this.L},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLA",{get:function(){return Z.HSL({h:this.H,s:this.S,l:this.L,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYK",{get:function(){return Z.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKA",{get:function(){return Z.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A},this.options)},enumerable:!1,configurable:!0}),n.toHEXObject=function(t){var e=ut(t);return yt(t,e,0,ft.HEX)},n.toHEX=function(t){return Z.HEX(n.toHEXObject(t))},n.toHEXAObject=function(t){var e=ut(t);return yt(t,e,0,ft.HEXA)},n.toHEXA=function(t){return Z.HEX(n.toHEXAObject(t))},n.toRGBObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.RGB)},n.toRGB=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.RGB);return Z.RGB(i,r)},n.toRGBAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.RGBA)},n.toRGBA=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.RGBA);return Z.RGB(i,r)},n.toHSLObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.HSL)},n.toHSL=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.HSL);return Z.HSL(i,r)},n.toHSLAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.HSLA)},n.toHSLA=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.HSLA);return Z.HSL(i,r)},n.toCMYKObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.CMYK)},n.toCMYK=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.CMYK);return Z.CMYK(i,r)},n.toCMYKAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return yt(t,n,e.decimals,ft.CMYKA)},n.toCMYKA=function(t,e){void 0===e&&(e={});var n=ut(t),r=U(e,t),i=yt(t,n,6,ft.CMYKA);return Z.CMYK(i,r)},n.getBlendHEXObject=function(t,e,n){return void 0===n&&(n=5),Et(t,e,n,0,ft.HEX)},n.getBlendHEX=function(t,e,r){return void 0===r&&(r=5),n.getBlendHEXObject(t,e,r).map((function(t){return Z.HEX(t)}))},n.getBlendHEXAObject=function(t,e,n){return void 0===n&&(n=5),Et(t,e,n,0,ft.HEXA)},n.getBlendHEXA=function(t,e,r){return void 0===r&&(r=5),n.getBlendHEXAObject(t,e,r).map((function(t){return Z.HEX(t)}))},n.getBlendRGBObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.RGB)},n.getBlendRGB=function(t,e,r,i){return void 0===r&&(r=5),void 0===i&&(i={}),n.getBlendRGBObject(t,e,r,i).map((function(n){return Z.RGB(n,U(i,t,e))}))},n.getBlendRGBAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.RGBA)},n.getBlendRGBA=function(t,e,r,i){return void 0===r&&(r=5),void 0===i&&(i={}),n.getBlendRGBAObject(t,e,r,i).map((function(n){return Z.RGB(n,U(i,t,e))}))},n.getBlendHSLObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.HSL)},n.getBlendHSL=function(t,e,r,i){void 0===r&&(r=5),void 0===i&&(i={});var o=U(i,t,e);return n.getBlendHSLObject(t,e,r,i).map((function(t){return Z.HSL(t,o)}))},n.getBlendHSLAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.HSLA)},n.getBlendHSLA=function(t,e,r,i){void 0===r&&(r=5),void 0===i&&(i={});var o=U(i,t,e);return n.getBlendHSLAObject(t,e,r,i).map((function(t){return Z.HSL(t,o)}))},n.getMixHEXObject=function(t,e){return void 0===e&&(e=i.ADDITIVE),gt.HEX(t,e,!1)},n.getMixHEX=function(t,e){return void 0===e&&(e=i.ADDITIVE),gt.HEX(t,e,!0)},n.getMixHEXAObject=function(t,e){return void 0===e&&(e=i.ADDITIVE),gt.HEXA(t,e,!1)},n.getMixHEXA=function(t,e){return void 0===e&&(e=i.ADDITIVE),gt.HEXA(t,e,!0)},n.getMixRGBObject=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.RGB(t,n,!1,U.apply(void 0,e([r],t,!1)))},n.getMixRGB=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.RGB(t,n,!0,U.apply(void 0,e([r],t,!1)))},n.getMixRGBAObject=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.RGBA(t,n,!1,U.apply(void 0,e([r],t,!1)))},n.getMixRGBA=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.RGBA(t,n,!0,U.apply(void 0,e([r],t,!1)))},n.getMixHSLObject=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.HSL(t,n,!1,U.apply(void 0,e([r],t,!1)))},n.getMixHSL=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.HSL(t,n,!0,U.apply(void 0,e([r],t,!1)))},n.getMixHSLAObject=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.HSLA(t,n,!1,U.apply(void 0,e([r],t,!1)))},n.getMixHSLA=function(t,n,r){return void 0===n&&(n=i.ADDITIVE),void 0===r&&(r={}),gt.HSLA(t,n,!0,U.apply(void 0,e([r],t,!1)))},n.getShades=function(t,e,n){return void 0===n&&(n={}),ht(t,e,!0,U(n,t))},n.getTints=function(t,e,n){return void 0===n&&(n={}),ht(t,e,!1,U(n,t))},n.getHarmony=function(t,e,n,o){return void 0===e&&(e=r.COMPLEMENTARY),void 0===n&&(n=i.ADDITIVE),void 0===o&&(o={}),function(t,e,n,i){var o;return(o={},o[r.ANALOGOUS]=pt.buildHarmony(e,nt,n,i),o[r.COMPLEMENTARY]=pt.buildHarmony(e,rt,n,i),o[r.SPLIT_COMPLEMENTARY]=pt.buildHarmony(e,it,n,i),o[r.TRIADIC]=pt.buildHarmony(e,ot,n,i),o[r.TETRADIC]=pt.buildHarmony(e,at,n,i),o[r.SQUARE]=pt.buildHarmony(e,ct,n,i),o)[t]}(e,t,n,U(o,t))},n}();export{Ft as ColorTranslator,r as Harmony,i as Mix};

@@ -48,2 +48,34 @@ type NumberOrString = number | string;

type ColorInput = string | Color;
declare enum AnglesUnitEnum {
NONE = "none",
DEGREES = "deg",
GRADIANS = "grad",
RADIANS = "rad",
TURNS = "turn"
}
declare enum ColorUnitEnum {
NONE = "none",
PERCENT = "percent"
}
declare enum CMYKFunctionEnum {
DEVICE_CMYK = "device-cmyk",
CMYK = "cmyk"
}
interface Options {
decimals: number;
legacyCSS: boolean;
spacesAfterCommas: boolean;
anglesUnit: AnglesUnitEnum;
rgbUnit: ColorUnitEnum;
cmykUnit: ColorUnitEnum;
alphaUnit: ColorUnitEnum;
cmykFunction: CMYKFunctionEnum;
}
type InputOptions = Partial<Omit<Options, "anglesUnit" | "rgbUnit" | "cmykUnit" | "alphaUnit" | "cmykFunction">> & {
anglesUnit?: `${AnglesUnitEnum}`;
rgbUnit?: `${ColorUnitEnum}`;
cmykUnit?: `${ColorUnitEnum}`;
alphaUnit?: `${ColorUnitEnum}`;
cmykFunction?: `${CMYKFunctionEnum}`;
};
declare enum Harmony {

@@ -62,7 +94,7 @@ ANALOGOUS = "ANALOGOUS",

declare class ColorTranslator {
constructor(color: ColorInput, decimals?: number);
constructor(color: ColorInput, options?: InputOptions);
private _options;
private rgb;
private hsl;
private cmyk;
private _decimals;
private updateRGB;

@@ -75,3 +107,3 @@ private updateRGBFromCMYK;

private updateRGBAndHSL;
setDecimals(decimals: number): ColorTranslator;
setOptions(options?: InputOptions): ColorTranslator;
setH(h: number): ColorTranslator;

@@ -88,3 +120,3 @@ setS(s: number): ColorTranslator;

setK(k: number): ColorTranslator;
get decimals(): number;
get options(): Options;
get H(): number;

@@ -117,81 +149,55 @@ get S(): number;

get CMYKA(): string;
static toHEXObject(color: ColorInput): HEXObject;
static toHEX(color: ColorInput): string;
static toHEX(color: ColorInput, css: true): string;
static toHEX(color: ColorInput, css: false): HEXObject;
static toHEXAObject(color: ColorInput): HEXObject;
static toHEXA(color: ColorInput): string;
static toHEXA(color: ColorInput, css: true): string;
static toHEXA(color: ColorInput, css: false): HEXObject;
static toRGB(color: ColorInput): string;
static toRGB(color: ColorInput, css: true, decimals?: number): string;
static toRGB(color: ColorInput, css: false, decimals?: number): RGBObject;
static toRGBA(color: ColorInput): string;
static toRGBA(color: ColorInput, css: true, decimals?: number): string;
static toRGBA(color: ColorInput, css: false, decimals?: number): RGBObject;
static toHSL(color: ColorInput): string;
static toHSL(color: ColorInput, css: true, decimals?: number): string;
static toHSL(color: ColorInput, css: false, decimals?: number): HSLObject;
static toHSLA(color: ColorInput): string;
static toHSLA(color: ColorInput, css: true, decimals?: number): string;
static toHSLA(color: ColorInput, css: false, decimals?: number): HSLObject;
static toCMYK(color: ColorInput): string;
static toCMYK(color: ColorInput, css: true, decimals?: number): string;
static toCMYK(color: ColorInput, css: false, decimals?: number): CMYKObject;
static toCMYKA(color: ColorInput): string;
static toCMYKA(color: ColorInput, css: true, decimals?: number): string;
static toCMYKA(color: ColorInput, css: false, decimals?: number): CMYKObject;
static toRGBObject(color: ColorInput, options?: InputOptions): RGBObject;
static toRGB(color: ColorInput, options?: InputOptions): string;
static toRGBAObject(color: ColorInput, options?: InputOptions): RGBObject;
static toRGBA(color: ColorInput, options?: InputOptions): string;
static toHSLObject(color: ColorInput, options?: InputOptions): HSLObject;
static toHSL(color: ColorInput, options?: InputOptions): string;
static toHSLAObject(color: ColorInput, options?: InputOptions): HSLObject;
static toHSLA(color: ColorInput, options?: InputOptions): string;
static toCMYKObject(color: ColorInput, options?: InputOptions): CMYKObject;
static toCMYK(color: ColorInput, options?: InputOptions): string;
static toCMYKAObject(color: ColorInput, options?: InputOptions): CMYKObject;
static toCMYKA(color: ColorInput, options?: InputOptions): string;
static getBlendHEXObject(from: ColorInput, to: ColorInput, steps?: number): HEXObject[];
static getBlendHEX(from: ColorInput, to: ColorInput, steps?: number): string[];
static getBlendHEX(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendHEX(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): HEXObject[];
static getBlendHEXAObject(from: ColorInput, to: ColorInput, steps?: number): HEXObject[];
static getBlendHEXA(from: ColorInput, to: ColorInput, steps?: number): string[];
static getBlendHEXA(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendHEXA(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): HEXObject[];
static getBlendRGB(from: ColorInput, to: ColorInput, steps?: number): string[];
static getBlendRGB(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendRGB(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): RGBObject[];
static getBlendRGBA(from: ColorInput, to: ColorInput, steps: number): string[];
static getBlendRGBA(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendRGBA(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): RGBObject[];
static getBlendHSL(from: ColorInput, to: ColorInput, steps?: number): string[];
static getBlendHSL(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendHSL(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): HSLObject[];
static getBlendHSLA(from: ColorInput, to: ColorInput, steps?: number): string[];
static getBlendHSLA(from: ColorInput, to: ColorInput, steps: number, css: true, decimals?: number): string[];
static getBlendHSLA(from: ColorInput, to: ColorInput, steps: number, css: false, decimals?: number): HSLObject[];
static getMixHEX(colors: ColorInput[]): string;
static getMixHEX(colors: ColorInput[], mode: Mix): string;
static getMixHEX(colors: ColorInput[], mode: Mix, css: true): string;
static getMixHEX(colors: ColorInput[], mode: Mix, css: false): HEXObject;
static getMixHEXA(colors: ColorInput[]): string;
static getMixHEXA(colors: ColorInput[], mode: Mix): string;
static getMixHEXA(colors: ColorInput[], mode: Mix, css: true): string;
static getMixHEXA(colors: ColorInput[], mode: Mix, css: false): HEXObject;
static getMixRGB(colors: ColorInput[]): string;
static getMixRGB(colors: ColorInput[], mode: Mix): string;
static getMixRGB(colors: ColorInput[], mode: Mix, css: true, decimals?: number): string;
static getMixRGB(colors: ColorInput[], mode: Mix, css: false, decimals?: number): RGBObject;
static getMixRGBA(colors: ColorInput[]): string;
static getMixRGBA(colors: ColorInput[], mode: Mix): string;
static getMixRGBA(colors: ColorInput[], mode: Mix, css: true, decimals?: number): string;
static getMixRGBA(colors: ColorInput[], mode: Mix, css: false, decimals?: number): RGBObject;
static getMixHSL(colors: ColorInput[]): string;
static getMixHSL(colors: ColorInput[], mode: Mix): string;
static getMixHSL(colors: ColorInput[], mode: Mix, css: true, decimals?: number): string;
static getMixHSL(colors: ColorInput[], mode: Mix, css: false, decimals?: number): HSLObject;
static getMixHSLA(colors: ColorInput[]): string;
static getMixHSLA(colors: ColorInput[], mode: Mix): string;
static getMixHSLA(colors: ColorInput[], mode: Mix, css: true, decimals?: number): string;
static getMixHSLA(colors: ColorInput[], mode: Mix, css: false, decimals?: number): HSLObject;
static getShades(color: string, shades: number, decimals?: number): string[];
static getShades(color: HEXObject, shades: number, decimals?: number): HEXObject[];
static getShades(color: RGBObject, shades: number, decimals?: number): RGBObject[];
static getShades(color: HSLObjectGeneric, shades: number, decimals?: number): HSLObject[];
static getTints(color: string, tints: number, decimals?: number): string[];
static getTints(color: HEXObject, tints: number, decimals?: number): HEXObject[];
static getTints(color: RGBObject, tints: number, decimals?: number): RGBObject[];
static getTints(color: HSLObjectGeneric, tints: number, decimals?: number): HSLObject[];
static getHarmony(color: string, harmony?: Harmony, mode?: Mix, decimals?: number): string[];
static getHarmony(color: HEXObject, harmony?: Harmony, mode?: Mix, decimals?: number): HEXObject[];
static getHarmony(color: RGBObject, harmony?: Harmony, mode?: Mix, decimals?: number): RGBObject[];
static getHarmony(color: HSLObjectGeneric, harmony?: Harmony, mode?: Mix, decimals?: number): HSLObject[];
static getBlendRGBObject(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): RGBObject[];
static getBlendRGB(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): string[];
static getBlendRGBAObject(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): RGBObject[];
static getBlendRGBA(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): string[];
static getBlendHSLObject(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): HSLObject[];
static getBlendHSL(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): string[];
static getBlendHSLAObject(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): HSLObject[];
static getBlendHSLA(from: ColorInput, to: ColorInput, steps?: number, options?: InputOptions): string[];
static getMixHEXObject(colors: ColorInput[], mode?: Mix): HEXObject;
static getMixHEX(colors: ColorInput[], mode?: Mix): string;
static getMixHEXAObject(colors: ColorInput[], mode?: Mix): HEXObject;
static getMixHEXA(colors: ColorInput[], mode?: Mix): string;
static getMixRGBObject(colors: ColorInput[], mode?: Mix, options?: InputOptions): RGBObject;
static getMixRGB(colors: ColorInput[], mode?: Mix, options?: InputOptions): string;
static getMixRGBAObject(colors: ColorInput[], mode?: Mix, options?: InputOptions): RGBObject;
static getMixRGBA(colors: ColorInput[], mode?: Mix, options?: InputOptions): string;
static getMixHSLObject(colors: ColorInput[], mode?: Mix, options?: InputOptions): HSLObject;
static getMixHSL(colors: ColorInput[], mode?: Mix, options?: InputOptions): string;
static getMixHSLAObject(colors: ColorInput[], mode?: Mix, options?: InputOptions): HSLObject;
static getMixHSLA(colors: ColorInput[], mode?: Mix, options?: InputOptions): string;
static getShades(color: string, shades: number, options?: InputOptions): string[];
static getShades(color: HEXObject, shades: number, options?: InputOptions): HEXObject[];
static getShades(color: RGBObject, shades: number, options?: InputOptions): RGBObject[];
static getShades(color: HSLObjectGeneric, shades: number, options?: InputOptions): HSLObject[];
static getTints(color: string, tints: number, options?: InputOptions): string[];
static getTints(color: HEXObject, tints: number, options?: InputOptions): HEXObject[];
static getTints(color: RGBObject, tints: number, options?: InputOptions): RGBObject[];
static getTints(color: HSLObjectGeneric, tints: number, options?: InputOptions): HSLObject[];
static getHarmony(color: string, harmony?: Harmony, mode?: Mix, options?: InputOptions): string[];
static getHarmony(color: HEXObject, harmony?: Harmony, mode?: Mix, options?: InputOptions): HEXObject[];
static getHarmony(color: RGBObject, harmony?: Harmony, mode?: Mix, options?: InputOptions): RGBObject[];
static getHarmony(color: HSLObjectGeneric, harmony?: Harmony, mode?: Mix, options?: InputOptions): HSLObject[];
}
export { ColorTranslator, Harmony, Mix, HEXObject, RGBObject, HSLObject, CMYKObject };
export { ColorTranslator, InputOptions, Harmony, Mix, HEXObject, RGBObject, HSLObject, CMYKObject };

@@ -1,1 +0,1 @@

"use strict";var t=function(){return t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}var r,n,i,o;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(r||(r={})),exports.Harmony=void 0,(n=exports.Harmony||(exports.Harmony={})).ANALOGOUS="ANALOGOUS",n.COMPLEMENTARY="COMPLEMENTARY",n.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",n.TRIADIC="TRIADIC",n.TETRADIC="TETRADIC",n.SQUARE="SQUARE",exports.Mix=void 0,(i=exports.Mix||(exports.Mix={})).ADDITIVE="ADDITIVE",i.SUBTRACTIVE="SUBTRACTIVE",function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(o||(o={}));var a,u,s,c,d,h,l,f=Object.keys(o),p={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},g={BGR:r.RGB,ABGR:r.RGB,HLS:r.HSL,AHLS:r.HSL,CKMY:r.CMYK,ACKMY:r.CMYK},b=((a={})[r.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,a[r.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a[r.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a[r.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,a),m=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,y=/^(\d+(?:\.\d+)?|\.\d+)%$/,F=/^0x([a-f\d]{1,2})$/i,A=/\{(\d+)\}/g,H="The provided string color doesn't have a correct format",v="The provided color object doesn't have the proper keys or format",E=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},B=function(t){return+"".concat(t).replace(y,"$1")},M=function(t){return y.test("".concat(t))?B(t):Math.min(+t,100)},C=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},R=function(t){var e=G(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},D=function(t,e){return void 0===e&&(e=!1),!e&&y.test(t)?Math.min(255*B(t)/100,255):F.test(t)?(3===t.length&&(t+=t.slice(-1)),e?G(t)/255:G(t)):Math.min(+t,e?1:255)},S=function(t){return Math.min(y.test(t)?B(t)/100:+t,1)},L=function(t){return e([],t,!0).sort().join("").toUpperCase()},G=function(t,e){void 0===e&&(e=6);var r=Math.pow(10,e);return Math.round(+t*r)/r},k=function(t,e,r){return Math.max(e,Math.min(t,r))},x=function(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),G(r<1?255*((e-t)*r+t):r<3?255*e:r<4?255*((e-t)*(4-r)+t):255*t)},O=function(t,e,r){e/=100;var n=(r/=100)<=.5?r*(e+1):r+e-r*e,i=2*r-n;return{r:x(i,n,(t/=60)+2),g:x(i,n,t),b:x(i,n,t-2)}},X=function(t,e,r,n){return{r:G(255*(1-t)*(n=1-n)),g:G(255*(1-e)*n),b:G(255*(1-r)*n)}},Y=function(t,e,r){t/=255,e/=255,r/=255;var n=1-Math.max(t,e,r),i=1-n,o=i&&(i-e)/i,a=i&&(i-r)/i;return{c:G(100*(i&&(i-t)/i)),m:G(100*o),y:G(100*a),k:G(100*n)}},j=function(t,e,r,n){void 0===n&&(n=1),t/=255,e/=255,r/=255,n=Math.min(n,1);var i=Math.max(t,e,r),o=Math.min(t,e,r),a=i-o,u=0,s=0,c=(i+o)/2;if(0!==a){switch(i){case t:u=(e-r)/a%6;break;case e:u=(r-t)/a+2;break;case r:u=(t-e)/a+4}(u=G(60*u))<0&&(u+=360),s=a/(1-Math.abs(2*c-1))}return{h:u,s:G(100*s),l:G(100*c),a:n}},K=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var r=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],i=e?n:r,o=0,a=0,u=0,s=0;return(e?r:n).find((function(e,r){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],u=i[r][0],s=i[r][1],!0)})),u+(s-u)/(a-o)*(t-o)},I=function(t,e){void 0===e&&(e=!1);var r=L(Object.keys(t));return p[g[r]].reduce((function(r,n){var i,o,a=t[n];return void 0!==a&&(e?r.push((i=G(a,0),1===(o=G(i,0).toString(16).toUpperCase()).length&&(o="0".concat(o)),o)):r.push(a)),r}),[])},T=function(t,e){return t.replace(A,(function(t,r){return"".concat(e[+r-1])}))},P=((u={})[r.HEX]=function(t){var e=I(t,!0),r=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return T(r,e)},u[r.RGB]=function(t){var e=I(t),r=4===e.length?"rgba({1},{2},{3},{4})":"rgb({1},{2},{3})";return T(r,e)},u[r.HSL]=function(t){var e=I(t),r=4===e.length?"hsla({1},{2}%,{3}%,{4})":"hsl({1},{2}%,{3}%)";return T(r,e)},u[r.CMYK]=function(t){var e=I(t),r=5===e.length?"cmyk({1}%,{2}%,{3}%,{4}%,{5})":"cmyk({1}%,{2}%,{3}%,{4}%)";return T(r,e)},u),w=function(t){if("string"==typeof t){var e=t.match(m),r=+e[1];switch(e[2]){case"rad":t=G(180*r/Math.PI);break;case"turn":t=G(360*r);break;default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},N=function(t){return"string"==typeof t&&(t=y.test(t)?B(t)/100:+t),isNaN(+t)||t>1?1:G(t)},V=function(r,n,i){return n.reduce((function(n,o){return e(e([],n,!0),[t(t({},r),{h:i===exports.Mix.ADDITIVE?w(r.h+o):w(K(K(r.h,!1)+o,!0))})],!1)}),[t({},r)])},U=function(t,e){return V(t,[30,-30],e)},q=function(t,e){return V(t,[180],e)},$=function(t,e){return V(t,[150,-150],e)},_=function(t,e){return V(t,[120,-120],e)},Q=function(t,e){return V(t,[60,-120,180],e)},z=function(t,e){return V(t,[90,-90,180],e)},J=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(r).some((function(r){if(b[r].test(t))return e=r,!0})),!e&&~f.indexOf(t)&&(e=r.HEX),!e)throw new Error(H);return e}(t):function(t){var e,n=!1,i=L(Object.keys(t));if(g[i]&&(e=g[i]),e&&e===r.RGB){var o=Object.entries(t).some((function(t){return!F.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(y.test("".concat(t[1]))||!F.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(n=!0),o||(e=r.HEX)}if(!e||n)throw new Error(v);return e}(t)},W=((s={})[r.HEX]=function(t){var e=(~f.indexOf(t)?o[t]:t).match(b.HEX),r={r:C(e[1]||e[5]),g:C(e[2]||e[6]),b:C(e[3]||e[7])},n=e[4]||e[8];return void 0!==n&&(r.a=C(n)/255),r},s[r.RGB]=function(t){var e=t.match(b.RGB),r=D(e[1]||e[5]),n=D(e[2]||e[6]),i=D(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(r,255),g:Math.min(n,255),b:Math.min(i,255)};return void 0!==o&&(a.a=N(o)),a},s[r.HSL]=function(t){var e=t.match(b.HSL),r=w(e[1]||e[5]),n=M(e[2]||e[6]),i=M(e[3]||e[7]),o=e[4]||e[8],a=O(r,n,i);return void 0!==o&&(a.a=N(o)),a},s[r.CMYK]=function(t){var e=t.match(b.CMYK),r=S(e[1]||e[6]),n=S(e[2]||e[7]),i=S(e[3]||e[8]),o=S(e[4]||e[9]),a=e[5]||e[10],u=X(r,n,i,o);return void 0!==a&&(u.a=N(a)),u},s),Z=((c={})[r.HEX]=function(t){var e={r:D("".concat(t.r)),g:D("".concat(t.g)),b:D("".concat(t.b))};return E(t,"a")&&(e.a=Math.min(D("".concat(t.a),!0),1)),e},c[r.RGB]=function(t){return this.HEX(t)},c[r.HSL]=function(t){var e=M("".concat(t.s)),r=M("".concat(t.l)),n=O(w(t.h),e,r);return E(t,"a")&&(n.a=N(t.a)),n},c[r.CMYK]=function(t){var e=S("".concat(t.c)),r=S("".concat(t.m)),n=S("".concat(t.y)),i=S("".concat(t.k)),o=X(e,r,n,i);return E(t,"a")&&(o.a=N(t.a)),o},c),tt=function(t,e){return void 0===e&&(e=J(t)),"string"==typeof t?W[e](t):Z[e](t)},et=((d={})[r.HEX]=function(t){return{r:R(t.r),g:R(t.g),b:R(t.b)}},d.HEXA=function(t){var e=et.HEX(t);return e.a=E(t,"a")?R(255*t.a):"0xFF",e},d[r.RGB]=function(t,e){return E(t,"a")&&delete t.a,ot(t,e)},d.RGBA=function(t,e){return t.a=E(t,"a")?G(t.a):1,ot(t,e)},d[r.HSL]=function(t,e){var r=j(t.r,t.g,t.b);return delete r.a,at(r,e)},d.HSLA=function(t,e){var r=et.HSL(t,e);return r.a=E(t,"a")?G(t.a,e):1,r},d[r.CMYK]=function(t,e){return ut(Y(t.r,t.g,t.b),e)},d.CMYKA=function(t,e){var r=et.CMYK(t,e);return r.a=E(t,"a")?G(t.a,e):1,r},d),rt=function(e,n,i,o){var a=J(e),u="string"==typeof e,s=tt(e,a),c="string"==typeof e&&E(s,"a")||"string"!=typeof e&&E(e,"a"),d=j(s.r,s.g,s.b,s.a);c||delete d.a;var h=i?d.l/(n+1):(100-d.l)/(n+1),l=Array(n).fill(null).map((function(e,r){return t(t({},d),{l:d.l+h*(r+1)*(1-2*+i)})}));switch(a){case r.HEX:default:return l.map((function(e){var r=O(e.h,e.s,e.l);return c&&(r.a=e.a),u?c?P.HEX(ot(t(t({},r),{a:G(255*r.a)}),o)):P.HEX(ot(r,o)):c?et.HEXA(r):et.HEX(r)}));case r.RGB:return l.map((function(t){var e=O(t.h,t.s,t.l);return c&&(e.a=t.a),u?P.RGB(ot(e,o)):c?et.RGBA(e,o):et.RGB(e,o)}));case r.HSL:return l.map((function(e){return u?P.HSL(at(e,o)):c?et.HSLA(t(t({},O(e.h,e.s,e.l)),{a:e.a}),o):et.HSL(O(e.h,e.s,e.l),o)}))}},nt=((h={buildHarmony:function(t,e,n,i){var o=J(t),a=tt(t,o),u=j(a.r,a.g,a.b,a.a),s="string"==typeof t&&E(a,"a")||"string"!=typeof t&&E(t,"a"),c="string"==typeof t;switch(o){case r.HEX:default:return s?this.HEXA(at(u,0),e,n,c):this.HEX(at(u,0),e,n,c);case r.HSL:return s?this.HSLA(u,e,n,c,i):this.HSL(u,e,n,c,i);case r.RGB:return s?this.RGBA(u,e,n,c,i):this.RGB(u,e,n,c,i)}}})[r.HEX]=function(t,e,r,n){return e(t,r).map((function(t){return n?P.HEX(O(t.h,t.s,t.l)):et.HEX(O(t.h,t.s,t.l))}))},h.HEXA=function(e,r,n,i){return r(e,n).map((function(e){return i?P.HEX(t(t({},O(e.h,e.s,e.l)),{a:255*N(e.a)})):et.HEXA(t(t({},O(e.h,e.s,e.l)),{a:N(e.a)}))}))},h[r.RGB]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?P.RGB(ot(O(t.h,t.s,t.l),i)):et.RGB(O(t.h,t.s,t.l),i)}))},h.RGBA=function(e,r,n,i,o){return r(e,n).map((function(e){return i?P.RGB(ot(t(t({},O(e.h,e.s,e.l)),{a:N(e.a)}),o)):et.RGBA(t(t({},O(e.h,e.s,e.l)),{a:N(e.a)}),o)}))},h[r.HSL]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?P.HSL(at({h:t.h,s:t.s,l:t.l},i)):et.HSL(O(t.h,t.s,t.l),i)}))},h.HSLA=function(e,r,n,i,o){return r(e,n).map((function(e){return i?P.HSL(at(t(t({},e),{a:N(e.a)}),o)):et.HSLA(t(t({},O(e.h,e.s,e.l)),{a:N(e.a)}),o)}))},h),it=((l={mix:function(e,r){var n,i,o,a,u,s,c,d,h,l,f,p,g,b,m,y=e.map((function(t){var e=J(t);return tt(t,e)})),F=r===exports.Mix.SUBTRACTIVE?y.map((function(t){var e,r,n,i,o,a,u,s,c,d,h,l,f,p,g=(e=t.r,r=t.g,n=t.b,i=Math.min(e,r,n),o=Math.min(255-e,255-r,255-n),a=e-i,u=r-i,s=n-i,c=Math.min(a,u),d=a-c,h=(u+c)/2,l=(s+u-c)/2,f=Math.max(d,h,l)/Math.max(a,u,s),p=isNaN(f)||f===1/0||f<=0?1:f,{r:d/p+o,y:h/p+o,b:l/p+o});return E(t,"a")&&(g.a=t.a),g})):null;function A(e){var n=r===exports.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return e.reduce((function(e,n){var i=E(n,"a")?n.a:1,o={r:Math.min(e.r+n.r*i,255),b:Math.min(e.b+n.b*i,255),a:1-(1-i)*(1-e.a)},a="g"in e?e.g:e.y,u="g"in n?n.g:n.y;return t(t({},o),r===exports.Mix.ADDITIVE?{g:Math.min(a+u*i,255)}:{y:Math.min(a+u*i,255)})}),n)}if(r===exports.Mix.ADDITIVE)n=A(y);else{var H=A(F);i=H.r,o=H.y,a=H.b,u=Math.min(i,o,a),s=Math.min(255-i,255-o,255-a),c=i-u,d=o-u,h=a-u,l=Math.min(d,h),f=c+d-l,p=d+l,g=2*(h-l),b=Math.max(f,p,g)/Math.max(c,d,h),m=isNaN(b)||b===1/0||b<=0?1:b,(n={r:f/m+s,g:p/m+s,b:g/m+s}).a=H.a}return{r:G(n.r),g:G(n.g),b:G(n.b),a:k(n.a,0,1)}}})[r.HEX]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?P.HEX(n):et.HEX(n)},l.HEXA=function(t,e,r){var n=this.mix(t,e);return n.a=r?255*N(n.a):N(n.a),r?P.HEX(n):et.HEXA(n)},l[r.RGB]=function(t,e,r,n){var i=this.mix(t,e);return delete i.a,r?P.RGB(i):et.RGB(i,n)},l.RGBA=function(t,e,r,n){var i=this.mix(t,e);return r?P.RGB(i):et.RGBA(i,n)},l[r.HSL]=function(t,e,r,n){var i=this.mix(t,e),o=j(i.r,i.g,i.b);return delete i.a,delete o.a,r?P.HSL(o):et.HSL(i,n)},l.HSLA=function(t,e,r,n){var i=this.mix(t,e),o=j(i.r,i.g,i.b,i.a);return r?P.HSL(o):et.HSLA(i,n)},l),ot=function(e,r){return t({r:G(e.r,r),g:G(e.g,r),b:G(e.b,r)},E(e,"a")?{a:G(e.a,r)}:{})},at=function(e,r){return t({h:G(e.h,r),s:G(e.s,r),l:G(e.l,r)},E(e,"a")?{a:G(e.a,r)}:{})},ut=function(t,e){return{c:G(t.c,e),m:G(t.m,e),y:G(t.y,e),k:G(t.k,e)}},st=function(t,e,r,n,i,o){var a=i(tt(t,e),n);return r?o(a):a},ct=function(t,e,r,n,i,o,a){r<1&&(r=5);var u=function(t,e,r){var n=r-1,i=(e.r-t.r)/n,o=(e.g-t.g)/n,a=(e.b-t.b)/n,u=N(t.a),s=(N(e.a)-u)/n;return Array(r).fill(null).map((function(r,c){return 0===c?t:c===n?e:{r:G(t.r+i*c),g:G(t.g+o*c),b:G(t.b+a*c),a:G(u+s*c)}}))}(tt(t),tt(e),r);return u.map((function(t){var e=o(t,i);return n?a(e):e}))},dt=function(){function e(t,e){void 0===e&&(e=6),this.rgb=tt(t),this._decimals=e,this.updateHSL(),this.updateCMYK()}return e.prototype.updateRGB=function(){this.rgb=t(t({},O(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},e.prototype.updateRGBFromCMYK=function(){this.rgb=t(t({},X(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},e.prototype.updateHSL=function(){this.hsl=j(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},e.prototype.updateCMYK=function(){this.cmyk=Y(this.rgb.r,this.rgb.g,this.rgb.b)},e.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},e.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},e.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},e.prototype.setDecimals=function(t){return this._decimals=t,this},e.prototype.setH=function(t){return this.hsl.h=w(t),this.updateRGBAndCMYK()},e.prototype.setS=function(t){return this.hsl.s=k(t,0,100),this.updateRGBAndCMYK()},e.prototype.setL=function(t){return this.hsl.l=k(t,0,100),this.updateRGBAndCMYK()},e.prototype.setR=function(t){return this.rgb.r=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setG=function(t){return this.rgb.g=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setB=function(t){return this.rgb.b=k(t,0,255),this.updateHSLAndCMYK()},e.prototype.setA=function(t){return this.hsl.a=this.rgb.a=k(t,0,1),this},e.prototype.setC=function(t){return this.cmyk.c=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setM=function(t){return this.cmyk.m=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setY=function(t){return this.cmyk.y=k(t,0,100),this.updateRGBAndHSL()},e.prototype.setK=function(t){return this.cmyk.k=k(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(e.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"H",{get:function(){return G(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"S",{get:function(){return G(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"L",{get:function(){return G(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"R",{get:function(){return G(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"G",{get:function(){return G(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return G(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"A",{get:function(){return G(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"C",{get:function(){return G(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"M",{get:function(){return G(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Y",{get:function(){return G(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"K",{get:function(){return G(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXObject",{get:function(){return et.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXAObject",{get:function(){return et.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBAObject",{get:function(){return t(t({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLAObject",{get:function(){return t(t({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKAObject",{get:function(){return t(t({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEX",{get:function(){return P.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HEXA",{get:function(){return P.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGB",{get:function(){return P.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"RGBA",{get:function(){return P.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSL",{get:function(){return P.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HSLA",{get:function(){return P.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYK",{get:function(){return P.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CMYKA",{get:function(){return P.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),e.toHEX=function(t,e){void 0===e&&(e=!0);var r=J(t);return st(t,r,e,0,et.HEX,P.HEX)},e.toHEXA=function(t,e){void 0===e&&(e=!0);var r=J(t);return st(t,r,e,0,et.HEXA,P.HEX)},e.toRGB=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.RGB,P.RGB)},e.toRGBA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.RGBA,P.RGB)},e.toHSL=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.HSL,P.HSL)},e.toHSLA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.HSLA,P.HSL)},e.toCMYK=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.CMYK,P.CMYK)},e.toCMYKA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=J(t);return st(t,n,e,r,et.CMYKA,P.CMYK)},e.getBlendHEX=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.HEX,P.HEX)},e.getBlendHEXA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.HEXA,P.HEX)},e.getBlendRGB=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.RGB,P.RGB)},e.getBlendRGBA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.RGBA,P.RGB)},e.getBlendHSL=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.HSL,P.HSL)},e.getBlendHSLA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),ct(t,e,r,n,i,et.HSLA,P.HSL)},e.getMixHEX=function(t,e,r){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),it.HEX(t,e,r)},e.getMixHEXA=function(t,e,r){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),it.HEXA(t,e,r)},e.getMixRGB=function(t,e,r,n){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.RGB(t,e,r,n)},e.getMixRGBA=function(t,e,r,n){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.RGBA(t,e,r,n)},e.getMixHSL=function(t,e,r,n){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.HSL(t,e,r,n)},e.getMixHSLA=function(t,e,r,n){return void 0===e&&(e=exports.Mix.ADDITIVE),void 0===r&&(r=!0),void 0===n&&(n=6),it.HSLA(t,e,r,n)},e.getShades=function(t,e,r){return void 0===r&&(r=6),rt(t,e,!0,r)},e.getTints=function(t,e,r){return void 0===r&&(r=6),rt(t,e,!1,r)},e.getHarmony=function(t,e,r,n){return void 0===e&&(e=exports.Harmony.COMPLEMENTARY),void 0===r&&(r=exports.Mix.ADDITIVE),void 0===n&&(n=6),function(t,e,r,n){var i;return(i={},i[exports.Harmony.ANALOGOUS]=nt.buildHarmony(e,U,n,r),i[exports.Harmony.COMPLEMENTARY]=nt.buildHarmony(e,q,n,r),i[exports.Harmony.SPLIT_COMPLEMENTARY]=nt.buildHarmony(e,$,n,r),i[exports.Harmony.TRIADIC]=nt.buildHarmony(e,_,n,r),i[exports.Harmony.TETRADIC]=nt.buildHarmony(e,Q,n,r),i[exports.Harmony.SQUARE]=nt.buildHarmony(e,z,n,r),i)[t]}(e,t,n,r)},e}();exports.ColorTranslator=dt;
"use strict";var t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},t.apply(this,arguments)};function e(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var n,r,i,o;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(n||(n={})),exports.Harmony=void 0,(r=exports.Harmony||(exports.Harmony={})).ANALOGOUS="ANALOGOUS",r.COMPLEMENTARY="COMPLEMENTARY",r.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",r.TRIADIC="TRIADIC",r.TETRADIC="TETRADIC",r.SQUARE="SQUARE",exports.Mix=void 0,(i=exports.Mix||(exports.Mix={})).ADDITIVE="ADDITIVE",i.SUBTRACTIVE="SUBTRACTIVE",function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(o||(o={}));var a,c,u=Object.keys(o),s={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},d={BGR:n.RGB,ABGR:n.RGB,HLS:n.HSL,AHLS:n.HSL,CKMY:n.CMYK,ACKMY:n.CMYK};!function(t){t.NUMBER="number",t.BOOLEAN="boolean"}(a||(a={}));var l,f,h,p=((c={})[n.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,c[n.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c[n.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c[n.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,c),g=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,m=/^(\d+(?:\.\d+)?|\.\d+)%$/,b=/^0x([a-f\d]{1,2})$/i,y=/\{(\d+)\}/g,A=/,( +|\d+)/g,E=/ +/,F="The provided string color doesn't have a correct format",v="The provided color object doesn't have the proper keys or format";!function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"}(l||(l={})),function(t){t.NONE="none",t.PERCENT="percent"}(f||(f={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(h||(h={}));var H,B,C,S,M,R,D={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:l.NONE,rgbUnit:f.NONE,cmykUnit:f.PERCENT,alphaUnit:f.NONE,cmykFunction:h.DEVICE_CMYK},O=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},L=function(t){return+"".concat(t).replace(m,"$1")},G=function(t){return m.test("".concat(t))?L(t):Math.min(+t,100)},k=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},x=function(t){var e=Y(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},j=function(t,e){return void 0===e&&(e=!1),!e&&m.test(t)?Math.min(255*L(t)/100,255):b.test(t)?(3===t.length&&(t+=t.slice(-1)),e?Y(t)/255:Y(t)):Math.min(+t,e?1:255)},X=function(t){return Math.min(m.test(t)?L(t)/100:+t,1)},I=function(t){return e([],t,!0).sort().join("").toUpperCase()},Y=function(t,e){void 0===e&&(e=6);var n=Math.pow(10,e);return Math.round(+t*n)/n},T=function(t,e,n){return Math.max(e,Math.min(t,n))},K=function(t){if("string"==typeof t){var e=t.match(g),n=+e[1];switch(e[2]){case l.RADIANS:t=Y(180*n/Math.PI);break;case l.TURNS:t=Y(360*n);break;case l.GRADIANS:t=Y(.9*n);break;case l.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},N=function(t,e){var n;switch(e){case l.RADIANS:n=Y(function(t){return t*Math.PI/180}(t));break;case l.TURNS:n=Y(t/360);break;case l.GRADIANS:n=Y(10/9*t);break;case l.DEGREES:case l.NONE:default:n=t}return n},P=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=[],i=[],o=[],c=[],u=[],s=Object.values(l),d=Object.values(f),b=Object.values(h),y={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0},F=0,v=e;F<v.length;F++){var H=v[F];if("string"==typeof H){if(r.push(H),H.includes(",")){y.legacyCSS++;var B=H.match(A);1===new Set(B).size&&E.test(B[0].slice(1))&&y.spacesAfterCommas++}if(H.match(p.HSL)){var C=(k=H.match(p.HSL))[1]||k[5],S=k[8],M=C.match(g)[2];i.push(""===M?l.NONE:M),u.push(m.test(S));continue}if(p.RGB.test(H)){var R=(k=H.match(p.RGB))[1]||k[5],O=k[2]||k[6],L=k[3]||k[7],G=k[8];o.push(m.test(R)&&m.test(O)&&m.test(L)),u.push(m.test(G));continue}if(H.match(p.CMYK)){var k,x=(k=H.match(p.CMYK))[1]||k[6],j=k[2]||k[7],X=k[3]||k[8],I=k[4]||k[9];G=k[10];c.push(m.test(x)&&m.test(j)&&m.test(X)&&m.test(I)),H.startsWith("cmyk")&&y.cmykFunction++,u.push(m.test(G))}}}return{decimals:typeof t.decimals===a.NUMBER?t.decimals:D.decimals,legacyCSS:typeof t.legacyCSS===a.BOOLEAN?t.legacyCSS:Boolean(r.length&&y.legacyCSS===r.length)||D.legacyCSS,spacesAfterCommas:typeof t.spacesAfterCommas===a.BOOLEAN?t.spacesAfterCommas:Boolean(r.length&&y.spacesAfterCommas===r.length)||D.spacesAfterCommas,anglesUnit:t.anglesUnit&&s.includes(t.anglesUnit)?t.anglesUnit:1===new Set(i).size?i[0]:D.anglesUnit,rgbUnit:t.rgbUnit&&d.includes(t.rgbUnit)?t.rgbUnit:1===new Set(o).size&&o[0]?f.PERCENT:D.rgbUnit,cmykUnit:t.cmykUnit&&d.includes(t.cmykUnit)?t.cmykUnit:1!==new Set(c).size||c[0]?D.cmykUnit:f.NONE,alphaUnit:t.alphaUnit&&d.includes(t.alphaUnit)?t.alphaUnit:1===new Set(u).size&&u[0]?f.PERCENT:D.alphaUnit,cmykFunction:t.cmykFunction&&b.includes(t.cmykFunction)?t.cmykFunction:c.length&&c.length===y.cmykFunction?h.CMYK:D.cmykFunction}},U=function(t,e,n){return n<0&&(n+=6),n>=6&&(n-=6),Y(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)},w=function(t,e,n){e/=100;var r=(n/=100)<=.5?n*(e+1):n+e-n*e,i=2*n-r;return{r:U(i,r,(t/=60)+2),g:U(i,r,t),b:U(i,r,t-2)}},V=function(t,e,n,r){return{r:Y(255*(1-t)*(r=1-r)),g:Y(255*(1-e)*r),b:Y(255*(1-n)*r)}},q=function(t,e,n){t/=255,e/=255,n/=255;var r=1-Math.max(t,e,n),i=1-r,o=i&&(i-e)/i,a=i&&(i-n)/i;return{c:Y(100*(i&&(i-t)/i)),m:Y(100*o),y:Y(100*a),k:Y(100*r)}},_=function(t,e,n,r){void 0===r&&(r=1),t/=255,e/=255,n/=255,r=Math.min(r,1);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=i-o,c=0,u=0,s=(i+o)/2;if(0!==a){switch(i){case t:c=(e-n)/a%6;break;case e:c=(n-t)/a+2;break;case n:c=(t-e)/a+4}(c=Y(60*c))<0&&(c+=360),u=a/(1-Math.abs(2*s-1))}return{h:c,s:Y(100*u),l:Y(100*s),a:r}},$=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var n=[[0,120],[120,180],[180,240],[240,360]],r=[[0,60],[60,120],[120,240],[240,360]],i=e?r:n,o=0,a=0,c=0,u=0;return(e?n:r).find((function(e,n){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],c=i[n][0],u=i[n][1],!0)})),c+(u-c)/(a-o)*(t-o)},z=function(t){return t?", ":","},Q=function(t,e){var n=I(Object.keys(t));return s[d[n]].reduce((function(n,r,i){var o=t[r];return void 0!==o&&n.push(e(o,i)),n}),[])},W=function(t,e){return t.replace(y,(function(t,n){return"".concat(e[+n-1])}))},J=function(t,e){var n=e.alphaUnit,r=e.legacyCSS,i=e.decimals;return n!==f.PERCENT||r?Y(t,i):"".concat(Y(100*t,i),"%")},Z=((H={})[n.HEX]=function(t){var e=Q(t,(function(t){return e=Y(t),1===(n=Y(e,0).toString(16).toUpperCase()).length&&(n="0".concat(n)),n;var e,n})),n=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return W(n,e)},H[n.RGB]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.rgbUnit,a=z(i),c=Q(t,(function(t,r){return o===f.PERCENT&&r<3?"".concat(function(t,e){return Y(t/255*100,e)}(t,n),"%"):3===r?J(t,e):Y(t,n)})),u=r?4===c.length?"rgba({1}".concat(a,"{2}").concat(a,"{3}").concat(a,"{4})"):"rgb({1}".concat(a,"{2}").concat(a,"{3})"):4===c.length?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return W(u,c)},H[n.HSL]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.anglesUnit,a=z(i),c=Q(t,(function(t,r){if(0===r&&o!==l.NONE){var i=Y(N(t,o),n);return"".concat(i).concat(o)}return 3===r?J(t,e):Y(t,n)})),u=r?4===c.length?"hsla({1}".concat(a,"{2}%").concat(a,"{3}%").concat(a,"{4})"):"hsl({1}".concat(a,"{2}%").concat(a,"{3}%)"):4===c.length?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return W(u,c)},H[n.CMYK]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.cmykUnit,a=e.cmykFunction,c=z(i),u=Q(t,(function(t,r){return o===f.PERCENT&&r<4?"".concat(Y(t,n),"%"):4===r?J(t,e):Y(t/100,n)})),s=r?5===u.length?"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4}").concat(c,"{5})"):"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4})"):5===u.length?"".concat(a,"({1} {2} {3} {4} / {5})"):"".concat(a,"({1} {2} {3} {4})");return W(s,u)},H),tt=function(t){return"string"==typeof t&&(t=m.test(t)?L(t)/100:+t),isNaN(+t)||t>1?1:Y(t)},et=function(n,r,i){return r.reduce((function(r,o){return e(e([],r,!0),[t(t({},n),{h:i===exports.Mix.ADDITIVE?K(n.h+o):K($($(n.h,!1)+o,!0))})],!1)}),[t({},n)])},nt=function(t,e){return et(t,[30,-30],e)},rt=function(t,e){return et(t,[180],e)},it=function(t,e){return et(t,[150,-150],e)},ot=function(t,e){return et(t,[120,-120],e)},at=function(t,e){return et(t,[60,-120,180],e)},ct=function(t,e){return et(t,[90,-90,180],e)},ut=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(n).some((function(n){if(p[n].test(t))return e=n,!0})),!e&&~u.indexOf(t)&&(e=n.HEX),!e)throw new Error(F);return e}(t):function(t){var e,r=!1,i=I(Object.keys(t));if(d[i]&&(e=d[i]),e&&e===n.RGB){var o=Object.entries(t).some((function(t){return!b.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(m.test("".concat(t[1]))||!b.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(r=!0),o||(e=n.HEX)}if(!e||r)throw new Error(v);return e}(t)},st=((B={})[n.HEX]=function(t){var e=(~u.indexOf(t)?o[t]:t).match(p.HEX),n={r:k(e[1]||e[5]),g:k(e[2]||e[6]),b:k(e[3]||e[7])},r=e[4]||e[8];return void 0!==r&&(n.a=k(r)/255),n},B[n.RGB]=function(t){var e=t.match(p.RGB),n=j(e[1]||e[5]),r=j(e[2]||e[6]),i=j(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(n,255),g:Math.min(r,255),b:Math.min(i,255)};return void 0!==o&&(a.a=tt(o)),a},B[n.HSL]=function(t){var e=t.match(p.HSL),n=K(e[1]||e[5]),r=G(e[2]||e[6]),i=G(e[3]||e[7]),o=e[4]||e[8],a=w(n,r,i);return void 0!==o&&(a.a=tt(o)),a},B[n.CMYK]=function(t){var e=t.match(p.CMYK),n=X(e[1]||e[6]),r=X(e[2]||e[7]),i=X(e[3]||e[8]),o=X(e[4]||e[9]),a=e[5]||e[10],c=V(n,r,i,o);return void 0!==a&&(c.a=tt(a)),c},B),dt=((C={})[n.HEX]=function(t){var e={r:j("".concat(t.r)),g:j("".concat(t.g)),b:j("".concat(t.b))};return O(t,"a")&&(e.a=Math.min(j("".concat(t.a),!0),1)),e},C[n.RGB]=function(t){return this.HEX(t)},C[n.HSL]=function(t){var e=G("".concat(t.s)),n=G("".concat(t.l)),r=w(K(t.h),e,n);return O(t,"a")&&(r.a=tt(t.a)),r},C[n.CMYK]=function(t){var e=X("".concat(t.c)),n=X("".concat(t.m)),r=X("".concat(t.y)),i=X("".concat(t.k)),o=V(e,n,r,i);return O(t,"a")&&(o.a=tt(t.a)),o},C),lt=function(t,e){return void 0===e&&(e=ut(t)),"string"==typeof t?st[e](t):dt[e](t)},ft=((S={})[n.HEX]=function(t){return{r:x(t.r),g:x(t.g),b:x(t.b)}},S.HEXA=function(t){var e=ft.HEX(t);return e.a=O(t,"a")?x(255*t.a):"0xFF",e},S[n.RGB]=function(t,e){var n=mt(t,e);return O(n,"a")&&delete n.a,n},S.RGBA=function(t,e){var n=ft.RGB(t,e);return n.a=O(t,"a")?Y(t.a):1,n},S[n.HSL]=function(t,e){var n=_(t.r,t.g,t.b);return delete n.a,bt(n,e)},S.HSLA=function(t,e){var n=ft.HSL(t,e);return n.a=O(t,"a")?Y(t.a,e):1,n},S[n.CMYK]=function(t,e){return yt(q(t.r,t.g,t.b),e)},S.CMYKA=function(t,e){var n=ft.CMYK(t,e);return n.a=O(t,"a")?Y(t.a,e):1,n},S),ht=function(e,r,i,o){var a=ut(e),c="string"==typeof e,u=lt(e,a),s="string"==typeof e&&O(u,"a")||"string"!=typeof e&&O(e,"a"),d=_(u.r,u.g,u.b,u.a);s||delete d.a;var l=i?d.l/(r+1):(100-d.l)/(r+1),f=Array(r).fill(null).map((function(e,n){return t(t({},d),{l:d.l+l*(n+1)*(1-2*+i)})}));switch(a){case n.HEX:default:return f.map((function(e){var n=w(e.h,e.s,e.l);return s&&(n.a=e.a),c?s?Z.HEX(t(t({},n),{a:Y(255*n.a)})):Z.HEX(n):s?ft.HEXA(n):ft.HEX(n)}));case n.RGB:return f.map((function(t){var e=w(t.h,t.s,t.l);return s&&(e.a=t.a),c?Z.RGB(e,o):s?ft.RGBA(e,o.decimals):ft.RGB(e,o.decimals)}));case n.HSL:return f.map((function(e){return c?Z.HSL(e,o):s?ft.HSLA(t(t({},w(e.h,e.s,e.l)),{a:e.a}),o.decimals):ft.HSL(w(e.h,e.s,e.l),o.decimals)}))}},pt=((M={buildHarmony:function(t,e,r,i){var o=ut(t),a=lt(t,o),c=_(a.r,a.g,a.b,a.a),u="string"==typeof t&&O(a,"a")||"string"!=typeof t&&O(t,"a"),s="string"==typeof t;switch(o){case n.HEX:default:return u?this.HEXA(bt(c,0),e,r,s):this.HEX(bt(c,0),e,r,s);case n.HSL:return u?this.HSLA(c,e,r,s,i):this.HSL(c,e,r,s,i);case n.RGB:return u?this.RGBA(c,e,r,s,i):this.RGB(c,e,r,s,i)}}})[n.HEX]=function(t,e,n,r){return e(t,n).map((function(t){return r?Z.HEX(w(t.h,t.s,t.l)):ft.HEX(w(t.h,t.s,t.l))}))},M.HEXA=function(e,n,r,i){return n(e,r).map((function(e){return i?Z.HEX(t(t({},w(e.h,e.s,e.l)),{a:255*tt(e.a)})):ft.HEXA(t(t({},w(e.h,e.s,e.l)),{a:tt(e.a)}))}))},M[n.RGB]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?Z.RGB(w(t.h,t.s,t.l),i):ft.RGB(w(t.h,t.s,t.l),i.decimals)}))},M.RGBA=function(e,n,r,i,o){return n(e,r).map((function(e){return i?Z.RGB(t(t({},w(e.h,e.s,e.l)),{a:tt(e.a)}),o):ft.RGBA(t(t({},w(e.h,e.s,e.l)),{a:tt(e.a)}),o.decimals)}))},M[n.HSL]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?Z.HSL({h:t.h,s:t.s,l:t.l},i):ft.HSL(w(t.h,t.s,t.l),i.decimals)}))},M.HSLA=function(e,n,r,i,o){return n(e,r).map((function(e){return i?Z.HSL(t(t({},e),{a:tt(e.a)}),o):ft.HSLA(t(t({},w(e.h,e.s,e.l)),{a:tt(e.a)}),o.decimals)}))},M),gt=((R={mix:function(e,n){var r,i,o,a,c,u,s,d,l,f,h,p,g,m,b,y=e.map((function(t){var e=ut(t);return lt(t,e)})),A=n===exports.Mix.SUBTRACTIVE?y.map((function(t){var e,n,r,i,o,a,c,u,s,d,l,f,h,p,g=(e=t.r,n=t.g,r=t.b,i=Math.min(e,n,r),o=Math.min(255-e,255-n,255-r),a=e-i,c=n-i,u=r-i,s=Math.min(a,c),d=a-s,l=(c+s)/2,f=(u+c-s)/2,h=Math.max(d,l,f)/Math.max(a,c,u),p=isNaN(h)||h===1/0||h<=0?1:h,{r:d/p+o,y:l/p+o,b:f/p+o});return O(t,"a")&&(g.a=t.a),g})):null;function E(e){var r=n===exports.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return e.reduce((function(e,r){var i=O(r,"a")?r.a:1,o={r:Math.min(e.r+r.r*i,255),b:Math.min(e.b+r.b*i,255),a:1-(1-i)*(1-e.a)},a="g"in e?e.g:e.y,c="g"in r?r.g:r.y;return t(t({},o),n===exports.Mix.ADDITIVE?{g:Math.min(a+c*i,255)}:{y:Math.min(a+c*i,255)})}),r)}if(n===exports.Mix.ADDITIVE)r=E(y);else{var F=E(A);i=F.r,o=F.y,a=F.b,c=Math.min(i,o,a),u=Math.min(255-i,255-o,255-a),s=i-c,d=o-c,l=a-c,f=Math.min(d,l),h=s+d-f,p=d+f,g=2*(l-f),m=Math.max(h,p,g)/Math.max(s,d,l),b=isNaN(m)||m===1/0||m<=0?1:m,(r={r:h/b+u,g:p/b+u,b:g/b+u}).a=F.a}return{r:Y(r.r),g:Y(r.g),b:Y(r.b),a:T(r.a,0,1)}}})[n.HEX]=function(t,e,n){var r=this.mix(t,e);return delete r.a,n?Z.HEX(r):ft.HEX(r)},R.HEXA=function(t,e,n){var r=this.mix(t,e);return r.a=n?255*tt(r.a):tt(r.a),n?Z.HEX(r):ft.HEXA(r)},R[n.RGB]=function(t,e,n,r){var i=this.mix(t,e);return delete i.a,n?Z.RGB(i,r):ft.RGB(i,r.decimals)},R.RGBA=function(t,e,n,r){var i=this.mix(t,e);return n?Z.RGB(i,r):ft.RGBA(i,r.decimals)},R[n.HSL]=function(t,e,n,r){var i=this.mix(t,e),o=_(i.r,i.g,i.b);return delete i.a,delete o.a,n?Z.HSL(o,r):ft.HSL(i,r.decimals)},R.HSLA=function(t,e,n,r){var i=this.mix(t,e),o=_(i.r,i.g,i.b,i.a);return n?Z.HSL(o,r):ft.HSLA(i,r.decimals)},R),mt=function(e,n){var r=Y(e.r,n),i=Y(e.g,n),o=Y(e.b,n);return t({r:r,g:i,b:o},O(e,"a")?{a:Y(e.a,n)}:{})},bt=function(e,n){return t({h:Y(e.h,n),s:Y(e.s,n),l:Y(e.l,n)},O(e,"a")?{a:Y(e.a,n)}:{})},yt=function(t,e){return{c:Y(t.c,e),m:Y(t.m,e),y:Y(t.y,e),k:Y(t.k,e)}},At=function(t,e,n,r){return r(lt(t,e),n)},Et=function(t,e,n,r,i){n<1&&(n=5);var o=function(t,e,n){var r=n-1,i=(e.r-t.r)/r,o=(e.g-t.g)/r,a=(e.b-t.b)/r,c=tt(t.a),u=(tt(e.a)-c)/r;return Array(n).fill(null).map((function(n,s){return 0===s?t:s===r?e:{r:Y(t.r+i*s),g:Y(t.g+o*s),b:Y(t.b+a*s),a:Y(c+u*s)}}))}(lt(t),lt(e),n);return o.map((function(t){return i(t,r)}))},Ft=function(){function n(t,e){void 0===e&&(e={}),this._options=P(e,t),this.rgb=lt(t),this.updateHSL(),this.updateCMYK()}return n.prototype.updateRGB=function(){this.rgb=t(t({},w(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},n.prototype.updateRGBFromCMYK=function(){this.rgb=t(t({},V(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},n.prototype.updateHSL=function(){this.hsl=_(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},n.prototype.updateCMYK=function(){this.cmyk=q(this.rgb.r,this.rgb.g,this.rgb.b)},n.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},n.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},n.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},n.prototype.setOptions=function(e){return void 0===e&&(e={}),this._options=t(t({},this._options),e),this},n.prototype.setH=function(t){return this.hsl.h=K(t),this.updateRGBAndCMYK()},n.prototype.setS=function(t){return this.hsl.s=T(t,0,100),this.updateRGBAndCMYK()},n.prototype.setL=function(t){return this.hsl.l=T(t,0,100),this.updateRGBAndCMYK()},n.prototype.setR=function(t){return this.rgb.r=T(t,0,255),this.updateHSLAndCMYK()},n.prototype.setG=function(t){return this.rgb.g=T(t,0,255),this.updateHSLAndCMYK()},n.prototype.setB=function(t){return this.rgb.b=T(t,0,255),this.updateHSLAndCMYK()},n.prototype.setA=function(t){return this.hsl.a=this.rgb.a=T(t,0,1),this},n.prototype.setC=function(t){return this.cmyk.c=T(t,0,100),this.updateRGBAndHSL()},n.prototype.setM=function(t){return this.cmyk.m=T(t,0,100),this.updateRGBAndHSL()},n.prototype.setY=function(t){return this.cmyk.y=T(t,0,100),this.updateRGBAndHSL()},n.prototype.setK=function(t){return this.cmyk.k=T(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(n.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"H",{get:function(){return Y(this.hsl.h,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"S",{get:function(){return Y(this.hsl.s,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"L",{get:function(){return Y(this.hsl.l,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"R",{get:function(){return Y(this.rgb.r,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"G",{get:function(){return Y(this.rgb.g,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"B",{get:function(){return Y(this.rgb.b,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"A",{get:function(){return Y(this.hsl.a,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"C",{get:function(){return Y(this.cmyk.c,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"M",{get:function(){return Y(this.cmyk.m,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Y",{get:function(){return Y(this.cmyk.y,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"K",{get:function(){return Y(this.cmyk.k,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXObject",{get:function(){return ft.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXAObject",{get:function(){return ft.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBAObject",{get:function(){return t(t({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLAObject",{get:function(){return t(t({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKAObject",{get:function(){return t(t({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEX",{get:function(){return Z.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HEXA",{get:function(){return Z.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGB",{get:function(){return Z.RGB({r:this.R,g:this.G,b:this.B},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RGBA",{get:function(){return Z.RGB({r:this.R,g:this.G,b:this.B,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSL",{get:function(){return Z.HSL({h:this.H,s:this.S,l:this.L},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"HSLA",{get:function(){return Z.HSL({h:this.H,s:this.S,l:this.L,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYK",{get:function(){return Z.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"CMYKA",{get:function(){return Z.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A},this.options)},enumerable:!1,configurable:!0}),n.toHEXObject=function(t){var e=ut(t);return At(t,e,0,ft.HEX)},n.toHEX=function(t){return Z.HEX(n.toHEXObject(t))},n.toHEXAObject=function(t){var e=ut(t);return At(t,e,0,ft.HEXA)},n.toHEXA=function(t){return Z.HEX(n.toHEXAObject(t))},n.toRGBObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.RGB)},n.toRGB=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.RGB);return Z.RGB(i,r)},n.toRGBAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.RGBA)},n.toRGBA=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.RGBA);return Z.RGB(i,r)},n.toHSLObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.HSL)},n.toHSL=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.HSL);return Z.HSL(i,r)},n.toHSLAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.HSLA)},n.toHSLA=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.HSLA);return Z.HSL(i,r)},n.toCMYKObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.CMYK)},n.toCMYK=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.CMYK);return Z.CMYK(i,r)},n.toCMYKAObject=function(t,e){void 0===e&&(e={});var n=ut(t);return At(t,n,e.decimals,ft.CMYKA)},n.toCMYKA=function(t,e){void 0===e&&(e={});var n=ut(t),r=P(e,t),i=At(t,n,6,ft.CMYKA);return Z.CMYK(i,r)},n.getBlendHEXObject=function(t,e,n){return void 0===n&&(n=5),Et(t,e,n,0,ft.HEX)},n.getBlendHEX=function(t,e,r){return void 0===r&&(r=5),n.getBlendHEXObject(t,e,r).map((function(t){return Z.HEX(t)}))},n.getBlendHEXAObject=function(t,e,n){return void 0===n&&(n=5),Et(t,e,n,0,ft.HEXA)},n.getBlendHEXA=function(t,e,r){return void 0===r&&(r=5),n.getBlendHEXAObject(t,e,r).map((function(t){return Z.HEX(t)}))},n.getBlendRGBObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.RGB)},n.getBlendRGB=function(t,e,r,i){return void 0===r&&(r=5),void 0===i&&(i={}),n.getBlendRGBObject(t,e,r,i).map((function(n){return Z.RGB(n,P(i,t,e))}))},n.getBlendRGBAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.RGBA)},n.getBlendRGBA=function(t,e,r,i){return void 0===r&&(r=5),void 0===i&&(i={}),n.getBlendRGBAObject(t,e,r,i).map((function(n){return Z.RGB(n,P(i,t,e))}))},n.getBlendHSLObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.HSL)},n.getBlendHSL=function(t,e,r,i){void 0===r&&(r=5),void 0===i&&(i={});var o=P(i,t,e);return n.getBlendHSLObject(t,e,r,i).map((function(t){return Z.HSL(t,o)}))},n.getBlendHSLAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),Et(t,e,n,r.decimals,ft.HSLA)},n.getBlendHSLA=function(t,e,r,i){void 0===r&&(r=5),void 0===i&&(i={});var o=P(i,t,e);return n.getBlendHSLAObject(t,e,r,i).map((function(t){return Z.HSL(t,o)}))},n.getMixHEXObject=function(t,e){return void 0===e&&(e=exports.Mix.ADDITIVE),gt.HEX(t,e,!1)},n.getMixHEX=function(t,e){return void 0===e&&(e=exports.Mix.ADDITIVE),gt.HEX(t,e,!0)},n.getMixHEXAObject=function(t,e){return void 0===e&&(e=exports.Mix.ADDITIVE),gt.HEXA(t,e,!1)},n.getMixHEXA=function(t,e){return void 0===e&&(e=exports.Mix.ADDITIVE),gt.HEXA(t,e,!0)},n.getMixRGBObject=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.RGB(t,n,!1,P.apply(void 0,e([r],t,!1)))},n.getMixRGB=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.RGB(t,n,!0,P.apply(void 0,e([r],t,!1)))},n.getMixRGBAObject=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.RGBA(t,n,!1,P.apply(void 0,e([r],t,!1)))},n.getMixRGBA=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.RGBA(t,n,!0,P.apply(void 0,e([r],t,!1)))},n.getMixHSLObject=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.HSL(t,n,!1,P.apply(void 0,e([r],t,!1)))},n.getMixHSL=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.HSL(t,n,!0,P.apply(void 0,e([r],t,!1)))},n.getMixHSLAObject=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.HSLA(t,n,!1,P.apply(void 0,e([r],t,!1)))},n.getMixHSLA=function(t,n,r){return void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),gt.HSLA(t,n,!0,P.apply(void 0,e([r],t,!1)))},n.getShades=function(t,e,n){return void 0===n&&(n={}),ht(t,e,!0,P(n,t))},n.getTints=function(t,e,n){return void 0===n&&(n={}),ht(t,e,!1,P(n,t))},n.getHarmony=function(t,e,n,r){return void 0===e&&(e=exports.Harmony.COMPLEMENTARY),void 0===n&&(n=exports.Mix.ADDITIVE),void 0===r&&(r={}),function(t,e,n,r){var i;return(i={},i[exports.Harmony.ANALOGOUS]=pt.buildHarmony(e,nt,n,r),i[exports.Harmony.COMPLEMENTARY]=pt.buildHarmony(e,rt,n,r),i[exports.Harmony.SPLIT_COMPLEMENTARY]=pt.buildHarmony(e,it,n,r),i[exports.Harmony.TRIADIC]=pt.buildHarmony(e,ot,n,r),i[exports.Harmony.TETRADIC]=pt.buildHarmony(e,at,n,r),i[exports.Harmony.SQUARE]=pt.buildHarmony(e,ct,n,r),i)[t]}(e,t,n,P(r,t))},n}();exports.ColorTranslator=Ft;
{
"name": "colortranslator",
"version": "2.0.0",
"version": "3.0.0",
"description": "A JavaScript library, written in TypeScript, to convert among different color models",

@@ -61,31 +61,31 @@ "main": "index.js",

"devDependencies": {
"@types/jest": "^29.5.1",
"@types/node": "^20.2.0",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.1",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"coveralls": "^3.1.1",
"css-loader": "^6.7.3",
"eslint": "^8.40.0",
"css-loader": "^6.8.1",
"eslint": "^8.44.0",
"google-code-prettify": "^1.0.5",
"html-webpack-plugin": "^5.5.1",
"jest": "^29.5.0",
"mini-css-extract-plugin": "^2.7.5",
"node-sass": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"jest": "^29.6.1",
"mini-css-extract-plugin": "^2.7.6",
"node-sass": "^9.0.0",
"plop": "^3.1.2",
"rimraf": "^5.0.1",
"rollup": "^3.22.0",
"rollup": "^3.26.2",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^3.2.0",
"sass-loader": "^13.2.2",
"style-loader": "^3.3.2",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.2",
"typescript": "^5.0.4",
"webpack": "^5.83.1",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0",
"sass-loader": "^13.3.2",
"style-loader": "^3.3.3",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typescript": "^5.1.6",
"webpack": "^5.88.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"whatwg-fetch": "^3.6.2"
}
}

@@ -103,36 +103,43 @@ <p align="center">

| `#F0FF` | Shorthand hexadecimal color with alpha |
| `rgb(255, 0, 255)` | Functional RGB notation |
| `rgba(255, 0, 255, 0.5)` | Functional RGB notation with alpha |
| `rgb(255 0 255)` | Functional RGB notation (CSS Colors 4 space-separated) |
| `rgba(255 0 255 / 0.5)` | Functional RGB notation with alpha (CSS Colors 4 space-separated) |
| `rgba(255 0 255 / 50%)` | Functional RGB notation CSS with alpha in percenatages (Colors 4 space-separated) |
| `hsl(300, 100%, 50%)` | Functional HSL notation |
| `hsl(300grad, 100%, 50%)` | Functional HSL notation with hue in grads |
| `hsl(300deg, 100%, 50%)` | Functional HSL notation with hue in degrees |
| `hsl(5.24rad, 100%, 50%)` | Functional HSL notation with hue in radians |
| `hsl(0.83turn, 100%, 50%)` | Functional HSL notation with hue in turns |
| `hsla(300, 100%, 50%, 0.5)` | Functional HSL notation with alpha |
| `hsl(300 100% 50%)` | Functional HSL notation (CSS Colors 4 space-separated) |
| `hsla(300 100% 50% / 0.5)` | Functional HSL notation with alpha (CSS Colors 4 space-separated) |
| `hsla(300 100% 50% / 50%)` | Functional HSL notation with alpha in percentages (CSS Colors 4 space-separated) |
| `cmyk(0%, 100%, 100%, 0%)` | Functional CMYK notation with percentages |
| `cmyk(0%, 100%, 100%, 0%, 1)` | Functional CMYK notation with percentages and alpha |
| `cmyk(0% 100% 100% 0%)` | Functional CMYK notation with percentages (CSS Colors 4 space-separated) |
| `cmyk(0% 100% 100% 0% / 1)` | Functional CMYK notation with percentages and alpha (CSS Colors 4 space-separated) |
| `cmyk(0% 100% 100% 0% / 100%)` | Functional CMYK notation with percentages and alpha in percentages (CSS Colors 4 space-separated) |
| `cmyk(0, 1, 1, 0)` | Functional CMYK notation with numbers |
| `cmyk(0, 1, 1, 0, 1)` | Functional CMYK notation with numbers and alpha |
| `cmyk(0 1 1 0)` | Functional CMYK notation with numbers (CSS Colors 4 space-separated) |
| `cmyk(0 1 1 0 / 1)` | Functional CMYK notation with numbers and alpha (CSS Colors 4 space-separated) |
| `cmyk(0 1 1 0 / 100%)` | Functional CMYK notation with numbers and alpha in percentages (CSS Colors 4 space-separated) |
| `device-cmyk(0%, 100%, 100%, 0%)` | Device-dependent functional CMYK notation with percentages |
| `device-cmyk(0%, 100%, 100%, 0%, 1)` | Device-dependent functional CMYK notation with percentages and alpha |
| `device-cmyk(0% 100% 100% 0%)` | Device-dependent functional CMYK notation with percentages (CSS Colors 4 space-separated) |
| `device-cmyk(0% 100% 100% 0% / 1)` | Device-dependent functional CMYK notation with percentages and alpha (CSS Colors 4 space-separated) |
| `device-cmyk(0% 100% 100% 0% / 100%)` | Device-dependent functional CMYK notation with percentages and alpha in percentages (CSS Colors 4 space-separated) |
| `device-cmyk(0, 1, 1, 0)` | Device-dependent functional CMYK notation with numbers |
| `device-cmyk(0, 1, 1, 0, 1)` | Device-dependent functional CMYK notation with numbers and alpha |
| `device-cmyk(0 1 1 0)` | Device-dependent functional CMYK notation with numbers (CSS Colors 4 space-separated) |
| `device-cmyk(0 1 1 0 / 1)` | Device-dependent functional CMYK notation with numbers and alpha (CSS Colors 4 space-separated) |
| `device-cmyk(0 1 1 0 / 100%)` | Device-dependent functional CMYK notation with numbers and alpha in percentages (CSS Colors 4 space-separated) |
| `rgb(255 0 255)` | Functional RGB notation |
| `rgb(100% 0% 100%)` | Functional RGB notation with values in percentages |
| `rgb(255 0 255 / 0.5)` | Functional RGB notation with alpha |
| `rgb(255 0 255 / 50%)` | Functional RGB notation CSS with alpha in percenatages |
| `rgb(100% 0% 100% / 0.5)` | Functional RGB notation with values in percentages and alpha |
| `rgb(100% 0% 100% / 50%)` | Functional RGB notation with values and alpha in percentages |
| `rgb(255, 0, 255)` | Functional RGB notation (CSS Colors 3 comma-separated) |
| `rgba(255, 0, 255, 0.5)` | Functional RGB notation with alpha (CSS Colors 3 comma-separated) |
| `hsl(300 100% 50%)` | Functional HSL notation |
| `hsl(300deg 100% 50%)` | Functional HSL notation with hue in degrees |
| `hsl(270grad 100% 50%)` | Functional HSL notation with hue in gradians |
| `hsl(5.24rad 100% 50%)` | Functional HSL notation with hue in radians |
| `hsl(0.83turn 100% 50%)` | Functional HSL notation with hue in turns |
| `hsl(300 100% 50% / 0.5)` | Functional HSL notation with alpha |
| `hsl(300 100% 50% / 50%)` | Functional HSL notation with alpha in percentages |
| `hsl(300, 100%, 50%)` | Functional HSL notation (Colors 3 comma-separated) |
| `hsl(300deg, 100%, 50%)` | Functional HSL notation with hue in degrees (CSS Colors 3 comma-separated) |
| `hsl(270grad, 100%, 50%)` | Functional HSL notation with hue in gradians (CSS Colors 3 comma-separated) |
| `hsl(5.24rad, 100%, 50%)` | Functional HSL notation with hue in radians (CSS Colors 3 comma-separated) |
| `hsl(0.83turn, 100%, 50%)` | Functional HSL notation with hue in turns (CSS Colors 3 comma-separated) |
| `hsla(300, 100%, 50%, 0.5)` | Functional HSL notation with alpha (CSS Colors 3 comma-separated) |
| `device-cmyk(0% 100% 100% 0%)` | Device-dependent functional CMYK notation with percentages |
| `device-cmyk(0% 100% 100% 0% / 1)` | Device-dependent functional CMYK notation with percentages and alpha |
| `device-cmyk(0% 100% 100% 0% / 100%)` | Device-dependent functional CMYK notation with percentages and alpha in percentages |
| `device-cmyk(0%, 100%, 100%, 0%)` | Device-dependent functional CMYK notation with percentages (CSS Colors 3 comma-separated) |
| `device-cmyk(0%, 100%, 100%, 0%, 1)` | Device-dependent functional CMYK notation with percentages and alpha (CSS Colors 3 comma-separated) |
| `device-cmyk(0 1 1 0)` | Device-dependent functional CMYK notation with numbers |
| `device-cmyk(0 1 1 0 / 1)` | Device-dependent functional CMYK notation with numbers and alpha |
| `device-cmyk(0 1 1 0 / 100%)` | Device-dependent functional CMYK notation with numbers and alpha in percentages |
| `device-cmyk(0, 1, 1, 0)` | Device-dependent functional CMYK notation with numbers (CSS Colors 3 comma-separated) |
| `device-cmyk(0, 1, 1, 0, 1)` | Device-dependent functional CMYK notation with numbers and alpha (CSS Colors 3 comma-separated) |
| `cmyk(0% 100% 100% 0%)` | Functional CMYK notation with percentages |
| `cmyk(0% 100% 100% 0% / 1)` | Functional CMYK notation with percentages and alpha |
| `cmyk(0% 100% 100% 0% / 100%)` | Functional CMYK notation with percentages and alpha in percentages |
| `cmyk(0 1 1 0)` | Functional CMYK notation with numbers |
| `cmyk(0 1 1 0 / 1)` | Functional CMYK notation with numbers and alpha |
| `cmyk(0 1 1 0 / 100%)` | Functional CMYK notation with numbers and alpha in percentages |
| `cmyk(0%, 100%, 100%, 0%)` | Functional CMYK notation with percentages (CSS Colors 3 comma-separated) |
| `cmyk(0%, 100%, 100%, 0%, 1)` | Functional CMYK notation with percentages and alpha (CSS Colors 3 comma-separated) |
| `cmyk(0, 1, 1, 0)` | Functional CMYK notation with numbers (CSS Colors 3 comma-separated) |
| `cmyk(0, 1, 1, 0, 1)` | Functional CMYK notation with numbers and alpha (CSS Colors 3 comma-separated) |

@@ -160,7 +167,43 @@

```javascript
ColorTranslator(color: ColorInput, decimals?: number = 6)
ColorTranslator(color: ColorInput, options?: Options)
```
It is possible to instantiate the class using any of the previous inputs:
It is possible to instantiate the class using any of the previous inputs.
###### Options object
```typescript
interface Options {
decimals?: number; // defaults to 6
legacyCSS?: boolean; // defaults to false
spacesAfterCommas?: boolean; // defaults to false
anglesUnit?: 'none' | 'deg' | 'grad' | 'rad' | 'turn'; // defaults to 'none'
rgbUnit?: 'none' | 'percent'; // defaults to 'none'
cmykUnit?: 'none' | 'percent'; // defaults to 'percent'
alphaUnit?: 'none' | 'percent'; // defaults to 'none'
cmykFunction?: 'device-cmyk' | 'cmyk'; // defaults to 'device-cmyk'
}
```
| Option | Only for CSS output | Description |
| ----------------- | ------------------- | -------------------------------------------------------------------------------------------------------------- |
| decimals | no | This option sets what is the maximum number of decimals for the outputs |
| legacyCSS | yes | This option decides if the CSS output should be CSS Level 3 (legacy) or CSS Level 4 |
| spacesAfterCommas | yes | This option only takes place if `legacyCSS` is set to true. It decides if the comas should have a space after |
| anglesUnit | yes | This option only takes place if the output is an HSL CSS output. It sets the degrees units of the HSL hue angle. If `none` is used, the output will not have any unit but its value will be the `deg` one (degrees) |
| rgbUnit | yes | This option only takes place if the output is an RGB CSS output. It sets the color units of the RGB and RGBA CSS outputs. If `none` is used the color values will be decimal between `0` and `255`. If `percent` is used, the color values will be decimal with percentages between `0%` and `100%`. |
| cmykUnit | yes | This option sets the color units of the CMYK and CMYKA CSS outputs. If `none` is used the color values will be decimal between `0` and `1`. If `percent` is used, the color values will be decimal with percentages between `0%` and `100%`. |
| alphaUnit | yes | This option only takes place if the output is a CSS Level 4 output (`legacyCSS` has not been set, or it has been set to `false` or it has been autodetected as `false`). This option sets the alpha units of the CSS Level 4 outputs. If `none` is used the alpha values will be decimal between `0` and `1`. If `percent` is used, the alpha values will be decimal with percentages between `0%` and `100%`. |
| cmykFunction | yes | This option sets the cmyk function of the CMYK and CMYKA CSS outputs. |
>Note: the library tries to detect some options automatically if you don‘t send them in the options object. These are the rules for this autodetection:
>
> * `legacyCSS`: if this option is set, then its value prevails, if it is not set, and the CSS input is provided in CSS Level 3, then this option will be `true`, otherwise it will take its default value which is `false`.
> * `spacesAfterCommas`: if this option is set, then its value prevails, if it is not set, and the CSS input is provided with spaces after the commas, then this option will be `true`. If the input is not consistent in this aspect, then it will take its default value which is `false` (This option only takes place if `legacyCSS` is `true` or it has been autodetected as `true`)
> * `anglesUnit`: if this option is set, then its value prevails, if it is not set, and the HSL CSS input is provided with an angle unit, then it will take that value, otherwise it will use the default one wich is `none`.
> * `rgbUnit`: if this option is set, then its value prevails, if it is not set, and the RGB CSS input is provided with percentages in its color values, then it will take the `pcent` value, otherwise it will use the default one wich is `none`.
> * `cmykUnit`: if this option is set, then its value prevails, if it is not set, and the CMYK CSS input is provided without percentages in its color values, then it will take the `none` value, otherwise it will use the default one wich is `percent`.
> * `alphaUnit`: if this option is set, then its value prevails, if it is not set, and the CSS input (must be CSS Level 4) is provided with percentages in its alpha value, then it will take the `percent` value, otherwise it will use the default one wich is `none`.
> * `cmykFunction`: if this option is set, then its value prevails, if it is not set, and the CMYK CSS input is provided using the `cmyk` function, then it will take the `cmyk` value, otherwise it will use the default one wich is `device-cmyk`.
###### Class instantiation examples

@@ -175,3 +218,3 @@

const hsl = new ColorTranslator('hsl(50, 20%, 90%)');
const hsl = new ColorTranslator('hsl(50 20% 90% / 0.5)');

@@ -183,20 +226,76 @@ const hsla = new ColorTranslator({ r: 115, g: 200, b: 150, a: 0.5 });

###### Configuration options examples
```javascript
// Decimals
new ColorTranslator('#F43227').HSL; // hsl(3.219512 90.30837% 55.490196%)
new ColorTranslator('#F43227', { decimals: 4 }).HSL; // hsl(3.2195 90.3084% 55.4902%)
new ColorTranslator('#F43227', { decimals: 0 }).HSL; // hsl(3 90% 55%)
new ColorTranslator('#F43227', { decimals: 2 }).HSLObject; // {h: 3.22, s: 90.31, l: 55.49}
// legacyCSS
new ColorTranslator('#FFF').RGBA; // rgb(255 255 255 / 1)
new ColorTranslator('#FFF', { legacyCSS: false }).RGBA; // rgb(255 255 255 / 1)
new ColorTranslator('#FFF', { legacyCSS: true }).RGBA; // rgba(255,255,255,1)
new ColorTranslator('hsla(100,30%,20%,0.5)').RGBA; // rgba(45.9,66.3,35.7,0.5)
new ColorTranslator('hsl(100 30% 20% / 0.5)').RGBA; // rgb(45.9 66.3 35.7 / 0.5)
// spacesAfterCommas
new ColorTranslator('#F00', { legacyCSS: true }).RGB; // rgb(255,0,0)
new ColorTranslator('#F00', { legacyCSS: true, spacesAfterCommas: true }).RGB; // rgb(255, 0, 0)
new ColorTranslator('hsla(100,30%,20%,0.25)').RGB; // rgb(45.9,66.3,35.7)
new ColorTranslator('hsl(100, 30%, 20%, 0.25)').RGB; // rgb(45.9, 66.3, 35.7)
// anglesUnit
new ColorTranslator('#0F0').HSL; // hsl(120 100% 50%)
new ColorTranslator('#0F0', { anglesUnit: 'none' }).HSL; // hsl(120 100% 50%)
new ColorTranslator('#0F0', { anglesUnit: 'deg' }).HSL; // hsl(120deg 100% 50%)
new ColorTranslator('#0F0', { anglesUnit: 'grad' }).HSL; // hsl(133.333333grad 100% 50%)
new ColorTranslator('#0F0', { anglesUnit: 'rad' }).HSL; // hsl(2.094395rad 100% 50%)
new ColorTranslator('#0F0', { anglesUnit: 'turn' }).HSL; // hsl(0.333333turn 100% 50%)
new ColorTranslator('hsl(0.5turn 100% 50% / 0.5)').HSL; // hsl(0.5turn 100% 50%)
// rgbUnit
new ColorTranslator('#0F0').RGB; // rgb(0 255 0)
new ColorTranslator('#0F0', { rgbUnit: 'none' }).RGB; // rgb(0 255 0)
new ColorTranslator('#0F0', { rgbUnit: 'percent' }).RGB; // rgb(0% 100% 0%)
new ColorTranslator('rgb(255 255 51 / 0.5)').RGB; // rgb(255 255 51)
new ColorTranslator('rgb(20% 100% 0% / 0.5)').RGB; // rgb(20% 100% 0%)
// cmykUnit
new ColorTranslator('#0F0').CMYK; // device-cmyk(100% 0% 100% 0%)
new ColorTranslator('#0F0', { cmykUnit: 'percent' }).CMYK; // device-cmyk(100% 0% 100% 0%)
new ColorTranslator('#0F0', { cmykUnit: 'none' }).CMYK; // device-cmyk(1 0 1 0)
// alphaUnit
new ColorTranslator('#0F0').RGBA; // rgb(0 255 0 / 1)
new ColorTranslator('#0F0', { alphaUnit: 'none' }).RGBA; // rgb(0 255 0 / 1)
new ColorTranslator('#0F0', { alphaUnit: 'percent' }).HSLA; // hsl(120 100% 50% / 100%)
new ColorTranslator('hsl(100 50% 20% / 0.25)').RGBA; // rgb(42.5 76.5 25.5 / 0.25)
new ColorTranslator('rgb(0 0 0 / 50%)').HSLA; // hsl(0 0% 0% / 50%)
// cmykFunction
new ColorTranslator('#00F').CMYKA; // device-cmyk(100% 100% 0% 0% / 1)
new ColorTranslator('#00F', { cmykFunction: 'device-cmyk' }).CMYK; // device-cmyk(100% 100% 0% 0%)
new ColorTranslator('#00F', { cmykFunction: 'cmyk' }).CMYKA; // cmyk(100% 100% 0% 0% / 1)
```
#### Class public methods
There are 11 chainable public methods and all of them accept a number as input:
There are 12 chainable public methods and 11 of them accept a number as input. The last one accepts an [options object](#options-object):
| Public methods | Input | Description |
| -------------- | --------------- | ------------------------------------------------------- |
| setH | 0 ≤ input ≤ 360 | Set the color hue |
| setS | 0 ≤ input ≤ 100 | Set the color saturation percentage |
| setL | 0 ≤ input ≤ 100 | Set the color lightness percentage |
| setR | 0 ≤ input ≤ 255 | Set the red value of the color |
| setG | 0 ≤ input ≤ 255 | Set the green value of the color |
| setB | 0 ≤ input ≤ 255 | Set the blue value of the color |
| setC | 0 ≤ input ≤ 100 | Set the CMYK cyan percentage value of the color |
| setM | 0 ≤ input ≤ 100 | Set the CMYK magenta percentage value of the color |
| setY | 0 ≤ input ≤ 100 | Set the CMYK yellow percentage value of the color |
| setK | 0 ≤ input ≤ 100 | Set the CMYK black percentage value of the color |
| setA | 0 ≤ input ≤ 1 | Set the alpha value of the color |
| setDecimals | number | Set the maximum number of decimals for the color values |
| Public methods | Input | Description |
| -------------- | --------------- | -------------------------------------------------------- |
| setH | 0 ≤ input ≤ 360 | Sets the color hue |
| setS | 0 ≤ input ≤ 100 | Sets the color saturation percentage |
| setL | 0 ≤ input ≤ 100 | Sets the color lightness percentage |
| setR | 0 ≤ input ≤ 255 | Sets the red value of the color |
| setG | 0 ≤ input ≤ 255 | Sets the green value of the color |
| setB | 0 ≤ input ≤ 255 | Sets the blue value of the color |
| setC | 0 ≤ input ≤ 100 | Sets the CMYK cyan percentage value of the color |
| setM | 0 ≤ input ≤ 100 | Sets the CMYK magenta percentage value of the color |
| setY | 0 ≤ input ≤ 100 | Sets the CMYK yellow percentage value of the color |
| setK | 0 ≤ input ≤ 100 | Sets the CMYK black percentage value of the color |
| setA | 0 ≤ input ≤ 1 | Sets the alpha value of the color |
| setOptions | Options | Sets an object that would work as configuration options |

@@ -225,45 +324,45 @@ ###### Class public methods examples

| Property | Description |
| -------- | --------------------------------------------------- |
| HEX | Get the the object hex representation of the color |
| HEXA | Get the the object hexa representation of the color |
| RGB | Get the the object rgb representation of the color |
| RGBA | Get the the object rgba representation of the color |
| HSL | Get the the object hsl representation of the color |
| HSLA | Get the the object hsla representation of the color |
| CMYK | Get the the object cmyk representation of the color |
| Property | Description |
| -------- | ---------------------------------------------------- |
| HEX | Gets the the object hex representation of the color |
| HEXA | Gets the the object hexa representation of the color |
| RGB | Gets the the object rgb representation of the color |
| RGBA | Gets the the object rgba representation of the color |
| HSL | Gets the the object hsl representation of the color |
| HSLA | Gets the the object hsla representation of the color |
| CMYK | Gets the the object cmyk representation of the color |
There are 7 properties to get the object representation of the color:
| Property | Description |
| ---------- | --------------------------------------------------- |
| HEXObject | Get the the object hex representation of the color |
| HEXAObject | Get the the object hexa representation of the color |
| RGBObject | Get the the object rgb representation of the color |
| RGBAObject | Get the the object rgba representation of the color |
| HSLObject | Get the the object hsl representation of the color |
| HSLAObject | Get the the object hsla representation of the color |
| CMYKObject | Get the the object cmyk representation of the color |
| Property | Description |
| ---------- | ---------------------------------------------------- |
| HEXObject | Gets the the object hex representation of the color |
| HEXAObject | Gets the the object hexa representation of the color |
| RGBObject | Gets the the object rgb representation of the color |
| RGBAObject | Gets the the object rgba representation of the color |
| HSLObject | Gets the the object hsl representation of the color |
| HSLAObject | Gets the the object hsla representation of the color |
| CMYKObject | Gets the the object cmyk representation of the color |
There are 11 properties to get the individual color values:
| Property | Description |
| -------- | -------------------------------------------------- |
| H | Get the color hue |
| S | Get the color saturation percentage |
| L | Get the color lightness percentage |
| R | Get the red value of the color |
| G | Get the green value of the color |
| B | Get the blue value of the color |
| C | Get the CMYK cyan percentage value of the color |
| M | Get the CMYK magenta percentage value of the color |
| Y | Get the CMYK yellow percentage value of the color |
| K | Get the CMYK black percentage value of the color |
| A | Get the alpha value of the color |
| Property | Description |
| -------- | --------------------------------------------------- |
| H | Gets the color hue |
| S | Gets the color saturation percentage |
| L | Gets the color lightness percentage |
| R | Gets the red value of the color |
| G | Gets the green value of the color |
| B | Gets the blue value of the color |
| C | Gets the CMYK cyan percentage value of the color |
| M | Gets the CMYK magenta percentage value of the color |
| Y | Gets the CMYK yellow percentage value of the color |
| K | Gets the CMYK black percentage value of the color |
| A | Gets the alpha value of the color |
And a property to get the maximum number of decimals for the color calculations
And a property to get the options object that acts as a [configuration object](#options-object) for the outputs
| Property | Description |
| -------- | ---------------------------------------------------------------- |
| decimals | Get maximum number of decimals for the color values calculations |
| Property | Description |
| -------- | ---------------------------------- |
| options | Get the configuration object value |

@@ -276,3 +375,3 @@

```javascript
const color = new ColorTranslator('#FF00FF', 2);
const color = new ColorTranslator('#FF00FF', { decimals: 2 });

@@ -282,5 +381,5 @@ color.R; // 255

color.B; // 255
color.RGB; // rgb(255,0,255)
color.HSLA; // hsla(300,100%,50%,1)
color.decimals; // 2
color.RGB; // rgb(255 0 255)
color.HSLA; // hsl(300 100% 50% / 1)
color.options; // { decimals: 2 }
```

@@ -292,7 +391,9 @@

There are 22 static methods available, 7 of them to convert colors, 6 to create color blends, one to get shades, one to get tints, 6 to mix colors, and one to create color harmonies.
There are 43 static methods available, 16 of them to convert colors, 12 to create color blends, 12 to mix colors, one to get shades, one to get tints, and one to create color harmonies.
>Note: The static methods also count with the options-autodetection feature that was explained in the [options object section](#options-object), but in this case it scans all the inputs that are CSS, and it tries to detect the options in each one of them. If one of the autodetected options is consistent in all the inputs, then it takes the autodetected value, otherwise it will use the default one.
###### Color conversion static methods
The static methods to convert colors accept any of the mentioned inputs as the first parameter. The second parameter is optional and it specifies if the output should be a CSS string or an object. The third parameter is also optional and it indicates the maximum number of decimals for the color values calculations (by default `6`):
The static methods to convert colors accept any of the mentioned inputs as the first parameter, the second parameter is optional and it is an [options object](#options-object) (this second option is not present in the methods to generate HEX colors):

@@ -302,4 +403,3 @@ ```typescript

color: string | object,
css: boolean = true,
decimals: number = 6
options?: Options
)

@@ -309,11 +409,18 @@ ```

| Static method | Description |
| ------------- | ---------------------------------------------- |
| toHEX | Convert to an hexadecimal notation |
| toHEXA | Convert to an hexadecimal notation with alpha |
| toRGB | Convert to an RGB notation |
| toRGBA | Convert to an RGB notation with alpha |
| toHSL | Convert to an HSL notation |
| toHSLA | Convert to an HSL notation with alpha |
| toCMYK | Convert to a CMYK notation |
| Static method | Description |
| ------------- | --------------------------------------------------------- |
| toHEX | Converts to an hexadecimal notation |
| toHEXObject | Converts to an object in hexadecimal notation |
| toHEXA | Converts to an hexadecimal notation with alpha |
| toHEXAObject | Converts to an object in hexadecimal notation with alpha |
| toRGB | Converts to an RGB notation |
| toRGBObject | Converts to an object in RGB notation |
| toRGBA | Converts to an RGB notation with alpha |
| toRGBAObject | Converts to an object in RGB notation with alpha |
| toHSL | Converts to an HSL notation |
| toHSLObject | Converts to an object in HSL notation |
| toHSLA | Converts to an HSL notation with alpha |
| toHSLAObject | Converts to an object in HSL notation with alpha |
| toCMYK | Converts to a CMYK notation |
| toCMYKObject | Converts to an object in CMYK notation |

@@ -325,19 +432,31 @@ ###### Color conversion static methods examples

ColorTranslator.toRGB('#FF00FF'); // rgb(255,0,255)
ColorTranslator.toRGB('#FF00FF'); // rgb(255 0 255)
ColorTranslator.toRGBA('hsl(50, 20%, 90%)', true, 0); // rgba(235,233,224,1)
ColorTranslator.toRGBA(
'hsl(50, 20%, 90%)',
{ decimals: 0 }
); // rgba(235,233,224,1)
ColorTranslator.toHSL('rgb(255, 0, 0)'); // hsl(0,100%,50%)
ColorTranslator.toHSL('rgb(255 0 0)'); // hsl(0 100% 50%)
ColorTranslator.toHSLA('rgba(0, 255, 255, 0.5)'); // hsla(180,100%,50%,0.5)
ColorTranslator.toCMYK('#F0F', false); // {c: 0, m: 100, y: 0, k: 0}
ColorTranslator.toCMYKObject('#F0F'); // {c: 0, m: 100, y: 0, k: 0}
ColorTranslator.toCMYK('#F0F'); // cmyk(0%,100%,0%,0%)
ColorTranslator.toCMYK('#F0F'); // cmyk(0% 100% 0% 0%)
ColorTranslator.toRGB({ h: 115, s: '70%', l: '45%' }, true, 0); // rgb(48,195,34)
ColorTranslator.toRGB(
{ h: 115, s: '70%', l: '45%' },
{ decimals: 0 }
); // rgb(48 195 34)
ColorTranslator.toHSLA({ r: 115, g: 200, b: 150, a: 0.5 }, true, 1); // hsla(144.7,43.6%,61.8%,0.5)
ColorTranslator.toHSLA(
{ r: 115, g: 200, b: 150, a: 0.5 },
{ decimals: 1 }
); // hsl(144.7 43.6% 61.8% / 0.5)
ColorTranslator.toHSLA({ r: 95, g: 23, b: 12, a: Math.SQRT1_2 }, true, 4); // hsla(7.9518,77.5701%,20.9804%,0.7071)
ColorTranslator.toHSLA(
{ r: 95, g: 23, b: 12, a: Math.SQRT1_2 },
{ decimals: 4 }
); // hsl(7.9518 77.5701% 20.9804% / 0.7071)
```

@@ -349,3 +468,3 @@

The static methods to create color blends accept any of the mentioned inputs as the first and second parameter, the third parameter is optional and it is the number of steps of the blending. The fourth parameter is also optional and it specifies if the output colors should be CSS strings or objects. And the fifth parameter is also optional and it indicates the maximum number of decimals for the color values calculations (by default `6`):
The static methods to create color blends accept any of the mentioned inputs as the first and second parameter, the third parameter is optional and it is the number of steps of the blending. And the fourth parameter is also optional and it is an [options object](#options-object) (this fourth option is not present in the methods to generate HEX colors):

@@ -357,4 +476,3 @@ ```typescript

steps: number = 5,
css: boolean = true,
decimals: number = 6
options?: Options
)

@@ -365,10 +483,16 @@ ```

| Static method | Description |
| ------------- | ------------------------------------------------------------------------------------------- |
| getBlendHEX | Create an array relative to the blend between two colors in hexadecimal notation |
| getBlendHEXA | Create an array relative to the blend between two colors in hexadecimal notation with alpha |
| getBlendRGB | Create an array relative to the blend between two colors in RGB notation |
| getBlendRGBA | Create an array relative to the blend between two colors in RGB notation with alpha |
| getBlendHSL | Create an array relative to the blend between two colors in HSL notation |
| getBlendHSLA | Create an array relative to the blend between two colors in HSL notation with alpha |
| Static method | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| getBlendHEX | Creates an array relative to the blend between two colors in hexadecimal notation |
| getBlendHEXObject | Creates an array of objects relative to the blend between two colors in hexadecimal notation |
| getBlendHEXA | Creates an array relative to the blend between two colors in hexadecimal notation with alpha |
| getBlendHEXAObject | Creates an array of objects relative to the blend between two colors in hexadecimal notation with alpha |
| getBlendRGB | Creates an array relative to the blend between two colors in RGB notation |
| getBlendRGBObject | Creates an array of objects relative to the blend between two colors in RGB notation |
| getBlendRGBA | Creates an array relative to the blend between two colors in RGB notation with alpha |
| getBlendRGBAObject | Creates an array of objects relative to the blend between two colors in RGB notation with alpha |
| getBlendHSL | Creates an array relative to the blend between two colors in HSL notation |
| getBlendHSLObject | Creates an array of objects relative to the blend between two colors in HSL notation |
| getBlendHSLA | Creates an array relative to the blend between two colors in HSL notation with alpha |
| getBlendHSLAObject | Creates an array of objects relative to the blend between two colors in HSL notation with alpha |

@@ -391,8 +515,8 @@ ###### Color blends static methods examples

// [
// "hsla(0,100%,50%,0)",
// "hsla(300,100%,25%,0.5)",
// "hsla(240,100%,50%,1)"
// "hsl(0 100% 50% / 0)",
// "hsl(300 100% 25% / 0.5)",
// "hsl(240 100% 50% / 1)"
// ]
ColorTranslator.getBlendRGBA('#F000', 'rgba(0,0,255,1)', 5, false);
ColorTranslator.getBlendRGBAObject('#F000', 'rgba(0,0,255,1)', 5);

@@ -410,5 +534,58 @@ // [

###### Color mix static methods
The static methods to mix colors accept an array of any of the mentioned inputs as the first parameter. The second parameter is optional and specifies the mixing mode (by default it will be `Mix.ADDITIVE`). And the third parameter is also optional and it is an [options object](#options-object) (this third option is not present in the methods to generate HEX colors):
> **Note:** The subtractive mix simulates the mixing of pigments, to achieve this, the rgb colors are converted to ryb color model, the addition is performed in this mode and at the end the result is converted back to rgb. The result is OK most of the time, but as this is not a real mix of pigments, sometimes the result could differ from the reality.
```typescript
getMixColorsStaticMethod(
colors: [string | object][],
mode: Mix = Mix.ADDITIVE,
options?: Options
)
```
###### Color mix static methods description
| Static method | Description |
| ---------------- | -------------------------------------------------------------------------------- |
| getMixHEX | Gets the mix of the input colors in hexadecimal notation |
| getMixHEXObject | Gets the mix of the input colors in an object in hexadecimal notation |
| getMixHEXA | Gets the mix of the input colors in hexadecimal notation with alpha |
| getMixHEXAObject | Gets the mix of the input colors in an object in hexadecimal notation with alpha |
| getMixRGB | Gets the mix of the input colors in RGB notation |
| getMixRGBObject | Gets the mix of the input colors in an object in RGB notation |
| getMixRGBA | Gets the mix of the input colors in RGB notation with alpha |
| getMixRGBAObject | Gets the mix of the input colors in an object in RGB notation with alpha |
| getMixHSL | Gets the mix of the input colors in HSL notation |
| getMixHSLObject | Gets the mix of the input colors in an object in HSL notation |
| getMixHSLA | Gets the mix of the input colors in HSL notation with alpha |
| getMixHSLAObject | Gets the mix of the input colors in an object in HSL notation with alpha |
###### Color mix static methods examples
```javascript
ColorTranslator.getMixHEX(['#FF0000', '#0000FF']);
// #FF00FF
ColorTranslator.getMixHSL(['rgba(255, 0, 0, 1)', '#00FF00']);
// hsl(60 100% 50%)
ColorTranslator.getMixHEXAObject(['#F00', 'rgb(0, 0, 255)'], Mix.ADDITIVE);
// { r: '0xFF', g: '0x00', b: '0xFF', a: '0xFF' }
ColorTranslator.getMixHEX(['#FF0', '#F00'], Mix.SUBTRACTIVE);
// #FF8800
```
You can also consult the [demo 7](https://elchininet.github.io/ColorTranslator/#demo7) and [demo 8](https://elchininet.github.io/ColorTranslator/#demo8) to check the use of these static methods.
###### Color shades and color tints static methods
The static methods to get [shades or tints of a color](https://en.m.wikipedia.org/wiki/Tints_and_shades) accept any of the mentioned inputs as the first parameter. The second parameter specifies the number of shades or tints that should be returned and the third parameter is optional and it indicates the maximum number of decimals for the color values calculations (by default `6`). This method will return the colors in the same format that was sent as input:
The static methods to get [shades or tints of a color](https://en.m.wikipedia.org/wiki/Tints_and_shades) accept any of the mentioned inputs as the first parameter. The second parameter specifies the number of shades or tints that should be returned and the third parameter is optional and it is an [options object](#options-object). This method will return the colors in the same format that was sent as input:

@@ -419,3 +596,3 @@ ```typescript

shades: number,
decimals: number = 6
options?: Options
)

@@ -426,3 +603,3 @@

tints: number,
decimals: number = 6
options?: Options
)

@@ -433,6 +610,6 @@ ```

| Static method | Description |
| ------------- | ------------------------------------------------------------------------------------------- |
| getShades | Get shades of a colour (mix the color with black increasing its darkness) |
| getTints | Get tints of a colour (mix the color with white increasing its lightness) |
| Static method | Description |
| ------------- | ---------------------------------------------------------------------------|
| getShades | Gets shades of a colour (mix the color with black increasing its darkness) |
| getTints | Gets tints of a colour (mix the color with white increasing its lightness) |

@@ -466,53 +643,5 @@

###### Color mix static methods
The static methods to mix colors accept an array of any of the mentioned inputs as the first parameter. The second parameter is optional and specifies the mixing mode (by default it will be `Mix.ADDITIVE`). The third parameter is also optional and it specifies if the output should be a CSS string or an object, and the fourth parameter is also optional and it indicates the maximum number of decimals for the color values calculations (by default `6`):
> **Note:** The subtractive mix simulates the mixing of pigments, to achieve this, the rgb colors are converted to ryb color model, the addition is performed in this mode and at the end the result is converted back to rgb. The result is OK most of the time, but as this is not a real mix of pigments, sometimes the result could differ from the reality.
```typescript
getMixColorsStaticMethod(
colors: [string | object][],
mode: Mix = Mix.ADDITIVE,
css: boolean = true,
decimals: number = 6
)
```
###### Color mix static methods description
| Static method | Description |
| ------------- | -------------------------------------------------------------------|
| getMixHEX | Get the mix of the input colors in hexadecimal notation |
| getMixHEXA | Get the mix of the input colors in hexadecimal notation with alpha |
| getMixRGB | Get the mix of the input colors in RGB notation |
| getMixRGBA | Get the mix of the input colors in RGB notation with alpha |
| getMixHSL | Get the mix of the input colors in HSL notation |
| getMixHSLA | Get the mix of the input colors in HSL notation with alpha |
###### Color mix static methods examples
```javascript
ColorTranslator.getMixHEX(['#FF0000', '#0000FF']);
// #FF00FF
ColorTranslator.getMixHSL(['rgba(255, 0, 0, 1)', '#00FF00']);
// hsl(60,100%,50%)
ColorTranslator.getMixHEXA(['#F00', 'rgb(0, 0, 255)'], Mix.ADDITIVE, false);
// { r: '0xFF', g: '0x00', b: '0xFF', a: '0xFF' }
ColorTranslator.getMixHEX(['#FF0', '#F00'], Mix.SUBTRACTIVE);
// #FF8800
```
You can also consult the [demo 7](https://elchininet.github.io/ColorTranslator/#demo7) and [demo 8](https://elchininet.github.io/ColorTranslator/#demo8) to check the use of these static methods.
###### Color harmonies static method
The static method to create color harmonies accepts four parmeters, the first one could be any of the mentioned inputs, the second one is optional and it is to specify the kind of harmony (by default it will be `Harmony.COMPLEMENTARY`), the third one is also optional and it specifies if the returned harmony is based on additive or subtractive colors (by default it will be `Mix.ADDITIVE`), and the fourth parameter is also optional and it indicates the maximum number of decimals for the color values calculations (by default `6`). This method will return the colors in the same format that was sent as input:
The static method to create color harmonies accepts four parmeters, the first one could be any of the mentioned inputs, the second one is optional and it is to specify the kind of harmony (by default it will be `Harmony.COMPLEMENTARY`), the third one is also optional and it specifies if the returned harmony is based on additive or subtractive colors (by default it will be `Mix.ADDITIVE`), and the fourth parameter is also optional and it is an [options object](#options-object). This method will return the colors in the same format that was sent as input:

@@ -524,3 +653,3 @@ ```typescript

mode: Mix = Mix.ADDITIVE,
decimals: number = 6
options?: Options
)

@@ -533,3 +662,3 @@ ```

| ------------- | ---------------------------------------------------------------------------- |
| getHarmony | Return an array of colors representing the harmony requested. The color output will be the same that was sent as input |
| getHarmony | Returns an array of colors representing the harmony requested. The color output will be the same that was sent as input |

@@ -554,11 +683,16 @@ ###### Available armonies

ColorTranslator.getHarmony('rgba(0, 255, 255, 0.5)', Harmony.ANALOGOUS);
ColorTranslator.getHarmony('rgba(0 255 255 / 0.5)', Harmony.ANALOGOUS);
// [
// "rgba(0,255,255,0.5)",
// "rgba(0,127.5,255,0.5)",
// "rgba(0,255,127.5,0.5)"
// "rgba(0 255 255 / 0.5)",
// "rgba(0 127.5 255 / 0.5)",
// "rgba(0 255 127.5 / 0.5)"
// ]
ColorTranslator.getHarmony({ r: 115, g: 200, b: 150, a: 0.5 }, Harmony.COMPLEMENTARY, false, 2);
ColorTranslator.getHarmony(
{ r: 115, g: 200, b: 150, a: 0.5 },
Harmony.COMPLEMENTARY,
Mix.ADDITIVE,
{ decimals: 2 }
);

@@ -582,5 +716,22 @@ // [

###### InputOptions
This is the type of the [options object](#options-object) that can be sent to the class constructor or to the static methods.
```typescript
interface InputOptions {
decimals?: number;
legacyCSS?: boolean;
spacesAfterCommas?: boolean;
anglesUnit?: 'none' | 'deg' | 'grad' | 'rad' | 'turn';
rgbUnit?: 'none' | 'percent';
cmykUnit?: 'none' | 'percent';
alphaUnit?: 'none' | 'percent';
cmykFunction?: 'device-cmyk' | 'cmyk';
}
```
###### HEXObject
This type is returned by the `HEXObject`, and `HEXAObject` properties, the `toHEX`, `toHEXA`, `getBlendHEX`, `getBlendHEXA`, `getMixHEX`, and `getMixHEXA` methods (when the `css` property is `false`), and the `getHarmony` method (when the input is an `HEXObject`).
This type is returned by the `HEXObject`, and `HEXAObject` properties, the `toHEXObject`, `toHEXAObject`, `getBlendHEXObject`, `getBlendHEXAObject`, `getMixHEXObject`, and the `getMixHEXAObject` methods, and the `getHarmony` method (when the input is an `HEXObject`).

@@ -598,3 +749,3 @@ ```typescript

This type is returned by the `RGBObject`, and `RGBAObject` properties, the `toRGB`, `toRGBA`, `getBlendRGB`, `getBlendRGBA`, `getMixRGB`, and `getMixRGBA` methods (when the `css` property is `false`), and the `getHarmony` method (when the input is an `RGBObject`).
This type is returned by the `RGBObject`, and `RGBAObject` properties, the `toRGBObject`, `toRGBAObject`, `getBlendRGBObject`, `getBlendRGBAObject`, `getMixRGBObject`, and the `getMixRGBAObject` methods, and the `getHarmony` method (when the input is an `RGBObject`).

@@ -612,3 +763,3 @@ ```typescript

This type is returned by the `HSLObject`, and `HSLAObject` properties, the `toHSL`, `toHSLA`, `getBlendHSL`, `getBlendHSLA`, `getMixHSL`, and `getMixHSLA` methods (when the `css` property is `false`), and the `getHarmony` method (when the input is an `HSLObject`).
This type is returned by the `HSLObject`, and `HSLAObject` properties, the `toHSLObject`, `toHSLAObject`, `getBlendHSLObject`, `getBlendHSLAObject`, `getMixHSLObject`, and the `getMixHSLAObject` methods, and the `getHarmony` method (when the input is an `HSLObject`).

@@ -626,3 +777,3 @@ ```typescript

This type is returned by the `CMYKObject` property, and the `toCMYK` method.
This type is returned by the `CMYKObject` property, and the `toCMYKObject` and `toCMYKAObject` methods.

@@ -629,0 +780,0 @@ ```typescript

@@ -1,1 +0,1 @@

var colortranslator=function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function r(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}var n,i,o,a;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(n||(n={})),t.Harmony=void 0,(i=t.Harmony||(t.Harmony={})).ANALOGOUS="ANALOGOUS",i.COMPLEMENTARY="COMPLEMENTARY",i.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",i.TRIADIC="TRIADIC",i.TETRADIC="TETRADIC",i.SQUARE="SQUARE",t.Mix=void 0,(o=t.Mix||(t.Mix={})).ADDITIVE="ADDITIVE",o.SUBTRACTIVE="SUBTRACTIVE",function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(a||(a={}));var u,c,s,d,h,l,f,g=Object.keys(a),p={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},b={BGR:n.RGB,ABGR:n.RGB,HLS:n.HSL,AHLS:n.HSL,CKMY:n.CMYK,ACKMY:n.CMYK},m=((u={})[n.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,u[n.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u[n.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u[n.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u),y=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,F=/^(\d+(?:\.\d+)?|\.\d+)%$/,A=/^0x([a-f\d]{1,2})$/i,H=/\{(\d+)\}/g,v="The provided string color doesn't have a correct format",E="The provided color object doesn't have the proper keys or format",B=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},M=function(t){return+"".concat(t).replace(F,"$1")},C=function(t){return F.test("".concat(t))?M(t):Math.min(+t,100)},R=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},D=function(t){var e=k(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},S=function(t,e){return void 0===e&&(e=!1),!e&&F.test(t)?Math.min(255*M(t)/100,255):A.test(t)?(3===t.length&&(t+=t.slice(-1)),e?k(t)/255:k(t)):Math.min(+t,e?1:255)},L=function(t){return Math.min(F.test(t)?M(t)/100:+t,1)},G=function(t){return r([],t,!0).sort().join("").toUpperCase()},k=function(t,e){void 0===e&&(e=6);var r=Math.pow(10,e);return Math.round(+t*r)/r},O=function(t,e,r){return Math.max(e,Math.min(t,r))},X=function(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),k(r<1?255*((e-t)*r+t):r<3?255*e:r<4?255*((e-t)*(4-r)+t):255*t)},Y=function(t,e,r){e/=100;var n=(r/=100)<=.5?r*(e+1):r+e-r*e,i=2*r-n;return{r:X(i,n,(t/=60)+2),g:X(i,n,t),b:X(i,n,t-2)}},j=function(t,e,r,n){return{r:k(255*(1-t)*(n=1-n)),g:k(255*(1-e)*n),b:k(255*(1-r)*n)}},K=function(t,e,r){t/=255,e/=255,r/=255;var n=1-Math.max(t,e,r),i=1-n,o=i&&(i-e)/i,a=i&&(i-r)/i;return{c:k(100*(i&&(i-t)/i)),m:k(100*o),y:k(100*a),k:k(100*n)}},I=function(t,e,r,n){void 0===n&&(n=1),t/=255,e/=255,r/=255,n=Math.min(n,1);var i=Math.max(t,e,r),o=Math.min(t,e,r),a=i-o,u=0,c=0,s=(i+o)/2;if(0!==a){switch(i){case t:u=(e-r)/a%6;break;case e:u=(r-t)/a+2;break;case r:u=(t-e)/a+4}(u=k(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:k(100*c),l:k(100*s),a:n}},T=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var r=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],i=e?n:r,o=0,a=0,u=0,c=0;return(e?r:n).find((function(e,r){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],u=i[r][0],c=i[r][1],!0)})),u+(c-u)/(a-o)*(t-o)},x=function(t,e){void 0===e&&(e=!1);var r=G(Object.keys(t));return p[b[r]].reduce((function(r,n){var i,o,a=t[n];return void 0!==a&&(e?r.push((i=k(a,0),1===(o=k(i,0).toString(16).toUpperCase()).length&&(o="0".concat(o)),o)):r.push(a)),r}),[])},P=function(t,e){return t.replace(H,(function(t,r){return"".concat(e[+r-1])}))},w=((c={})[n.HEX]=function(t){var e=x(t,!0),r=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return P(r,e)},c[n.RGB]=function(t){var e=x(t),r=4===e.length?"rgba({1},{2},{3},{4})":"rgb({1},{2},{3})";return P(r,e)},c[n.HSL]=function(t){var e=x(t),r=4===e.length?"hsla({1},{2}%,{3}%,{4})":"hsl({1},{2}%,{3}%)";return P(r,e)},c[n.CMYK]=function(t){var e=x(t),r=5===e.length?"cmyk({1}%,{2}%,{3}%,{4}%,{5})":"cmyk({1}%,{2}%,{3}%,{4}%)";return P(r,e)},c),N=function(t){if("string"==typeof t){var e=t.match(y),r=+e[1];switch(e[2]){case"rad":t=k(180*r/Math.PI);break;case"turn":t=k(360*r);break;default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},V=function(t){return"string"==typeof t&&(t=F.test(t)?M(t)/100:+t),isNaN(+t)||t>1?1:k(t)},U=function(n,i,o){return i.reduce((function(i,a){return r(r([],i,!0),[e(e({},n),{h:o===t.Mix.ADDITIVE?N(n.h+a):N(T(T(n.h,!1)+a,!0))})],!1)}),[e({},n)])},q=function(t,e){return U(t,[30,-30],e)},$=function(t,e){return U(t,[180],e)},_=function(t,e){return U(t,[150,-150],e)},Q=function(t,e){return U(t,[120,-120],e)},z=function(t,e){return U(t,[60,-120,180],e)},J=function(t,e){return U(t,[90,-90,180],e)},W=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(n).some((function(r){if(m[r].test(t))return e=r,!0})),!e&&~g.indexOf(t)&&(e=n.HEX),!e)throw new Error(v);return e}(t):function(t){var e,r=!1,i=G(Object.keys(t));if(b[i]&&(e=b[i]),e&&e===n.RGB){var o=Object.entries(t).some((function(t){return!A.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(F.test("".concat(t[1]))||!A.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(r=!0),o||(e=n.HEX)}if(!e||r)throw new Error(E);return e}(t)},Z=((s={})[n.HEX]=function(t){var e=(~g.indexOf(t)?a[t]:t).match(m.HEX),r={r:R(e[1]||e[5]),g:R(e[2]||e[6]),b:R(e[3]||e[7])},n=e[4]||e[8];return void 0!==n&&(r.a=R(n)/255),r},s[n.RGB]=function(t){var e=t.match(m.RGB),r=S(e[1]||e[5]),n=S(e[2]||e[6]),i=S(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(r,255),g:Math.min(n,255),b:Math.min(i,255)};return void 0!==o&&(a.a=V(o)),a},s[n.HSL]=function(t){var e=t.match(m.HSL),r=N(e[1]||e[5]),n=C(e[2]||e[6]),i=C(e[3]||e[7]),o=e[4]||e[8],a=Y(r,n,i);return void 0!==o&&(a.a=V(o)),a},s[n.CMYK]=function(t){var e=t.match(m.CMYK),r=L(e[1]||e[6]),n=L(e[2]||e[7]),i=L(e[3]||e[8]),o=L(e[4]||e[9]),a=e[5]||e[10],u=j(r,n,i,o);return void 0!==a&&(u.a=V(a)),u},s),tt=((d={})[n.HEX]=function(t){var e={r:S("".concat(t.r)),g:S("".concat(t.g)),b:S("".concat(t.b))};return B(t,"a")&&(e.a=Math.min(S("".concat(t.a),!0),1)),e},d[n.RGB]=function(t){return this.HEX(t)},d[n.HSL]=function(t){var e=C("".concat(t.s)),r=C("".concat(t.l)),n=Y(N(t.h),e,r);return B(t,"a")&&(n.a=V(t.a)),n},d[n.CMYK]=function(t){var e=L("".concat(t.c)),r=L("".concat(t.m)),n=L("".concat(t.y)),i=L("".concat(t.k)),o=j(e,r,n,i);return B(t,"a")&&(o.a=V(t.a)),o},d),et=function(t,e){return void 0===e&&(e=W(t)),"string"==typeof t?Z[e](t):tt[e](t)},rt=((h={})[n.HEX]=function(t){return{r:D(t.r),g:D(t.g),b:D(t.b)}},h.HEXA=function(t){var e=rt.HEX(t);return e.a=B(t,"a")?D(255*t.a):"0xFF",e},h[n.RGB]=function(t,e){return B(t,"a")&&delete t.a,at(t,e)},h.RGBA=function(t,e){return t.a=B(t,"a")?k(t.a):1,at(t,e)},h[n.HSL]=function(t,e){var r=I(t.r,t.g,t.b);return delete r.a,ut(r,e)},h.HSLA=function(t,e){var r=rt.HSL(t,e);return r.a=B(t,"a")?k(t.a,e):1,r},h[n.CMYK]=function(t,e){return ct(K(t.r,t.g,t.b),e)},h.CMYKA=function(t,e){var r=rt.CMYK(t,e);return r.a=B(t,"a")?k(t.a,e):1,r},h),nt=function(t,r,i,o){var a=W(t),u="string"==typeof t,c=et(t,a),s="string"==typeof t&&B(c,"a")||"string"!=typeof t&&B(t,"a"),d=I(c.r,c.g,c.b,c.a);s||delete d.a;var h=i?d.l/(r+1):(100-d.l)/(r+1),l=Array(r).fill(null).map((function(t,r){return e(e({},d),{l:d.l+h*(r+1)*(1-2*+i)})}));switch(a){case n.HEX:default:return l.map((function(t){var r=Y(t.h,t.s,t.l);return s&&(r.a=t.a),u?s?w.HEX(at(e(e({},r),{a:k(255*r.a)}),o)):w.HEX(at(r,o)):s?rt.HEXA(r):rt.HEX(r)}));case n.RGB:return l.map((function(t){var e=Y(t.h,t.s,t.l);return s&&(e.a=t.a),u?w.RGB(at(e,o)):s?rt.RGBA(e,o):rt.RGB(e,o)}));case n.HSL:return l.map((function(t){return u?w.HSL(ut(t,o)):s?rt.HSLA(e(e({},Y(t.h,t.s,t.l)),{a:t.a}),o):rt.HSL(Y(t.h,t.s,t.l),o)}))}},it=((l={buildHarmony:function(t,e,r,i){var o=W(t),a=et(t,o),u=I(a.r,a.g,a.b,a.a),c="string"==typeof t&&B(a,"a")||"string"!=typeof t&&B(t,"a"),s="string"==typeof t;switch(o){case n.HEX:default:return c?this.HEXA(ut(u,0),e,r,s):this.HEX(ut(u,0),e,r,s);case n.HSL:return c?this.HSLA(u,e,r,s,i):this.HSL(u,e,r,s,i);case n.RGB:return c?this.RGBA(u,e,r,s,i):this.RGB(u,e,r,s,i)}}})[n.HEX]=function(t,e,r,n){return e(t,r).map((function(t){return n?w.HEX(Y(t.h,t.s,t.l)):rt.HEX(Y(t.h,t.s,t.l))}))},l.HEXA=function(t,r,n,i){return r(t,n).map((function(t){return i?w.HEX(e(e({},Y(t.h,t.s,t.l)),{a:255*V(t.a)})):rt.HEXA(e(e({},Y(t.h,t.s,t.l)),{a:V(t.a)}))}))},l[n.RGB]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?w.RGB(at(Y(t.h,t.s,t.l),i)):rt.RGB(Y(t.h,t.s,t.l),i)}))},l.RGBA=function(t,r,n,i,o){return r(t,n).map((function(t){return i?w.RGB(at(e(e({},Y(t.h,t.s,t.l)),{a:V(t.a)}),o)):rt.RGBA(e(e({},Y(t.h,t.s,t.l)),{a:V(t.a)}),o)}))},l[n.HSL]=function(t,e,r,n,i){return e(t,r).map((function(t){return n?w.HSL(ut({h:t.h,s:t.s,l:t.l},i)):rt.HSL(Y(t.h,t.s,t.l),i)}))},l.HSLA=function(t,r,n,i,o){return r(t,n).map((function(t){return i?w.HSL(ut(e(e({},t),{a:V(t.a)}),o)):rt.HSLA(e(e({},Y(t.h,t.s,t.l)),{a:V(t.a)}),o)}))},l),ot=((f={mix:function(r,n){var i,o,a,u,c,s,d,h,l,f,g,p,b,m,y,F=r.map((function(t){var e=W(t);return et(t,e)})),A=n===t.Mix.SUBTRACTIVE?F.map((function(t){var e,r,n,i,o,a,u,c,s,d,h,l,f,g,p=(e=t.r,r=t.g,n=t.b,i=Math.min(e,r,n),o=Math.min(255-e,255-r,255-n),a=e-i,u=r-i,c=n-i,s=Math.min(a,u),d=a-s,h=(u+s)/2,l=(c+u-s)/2,f=Math.max(d,h,l)/Math.max(a,u,c),g=isNaN(f)||f===1/0||f<=0?1:f,{r:d/g+o,y:h/g+o,b:l/g+o});return B(t,"a")&&(p.a=t.a),p})):null;function H(r){var i=n===t.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return r.reduce((function(r,i){var o=B(i,"a")?i.a:1,a={r:Math.min(r.r+i.r*o,255),b:Math.min(r.b+i.b*o,255),a:1-(1-o)*(1-r.a)},u="g"in r?r.g:r.y,c="g"in i?i.g:i.y;return e(e({},a),n===t.Mix.ADDITIVE?{g:Math.min(u+c*o,255)}:{y:Math.min(u+c*o,255)})}),i)}if(n===t.Mix.ADDITIVE)i=H(F);else{var v=H(A);o=v.r,a=v.y,u=v.b,c=Math.min(o,a,u),s=Math.min(255-o,255-a,255-u),d=o-c,h=a-c,l=u-c,f=Math.min(h,l),g=d+h-f,p=h+f,b=2*(l-f),m=Math.max(g,p,b)/Math.max(d,h,l),y=isNaN(m)||m===1/0||m<=0?1:m,(i={r:g/y+s,g:p/y+s,b:b/y+s}).a=v.a}return{r:k(i.r),g:k(i.g),b:k(i.b),a:O(i.a,0,1)}}})[n.HEX]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?w.HEX(n):rt.HEX(n)},f.HEXA=function(t,e,r){var n=this.mix(t,e);return n.a=r?255*V(n.a):V(n.a),r?w.HEX(n):rt.HEXA(n)},f[n.RGB]=function(t,e,r,n){var i=this.mix(t,e);return delete i.a,r?w.RGB(i):rt.RGB(i,n)},f.RGBA=function(t,e,r,n){var i=this.mix(t,e);return r?w.RGB(i):rt.RGBA(i,n)},f[n.HSL]=function(t,e,r,n){var i=this.mix(t,e),o=I(i.r,i.g,i.b);return delete i.a,delete o.a,r?w.HSL(o):rt.HSL(i,n)},f.HSLA=function(t,e,r,n){var i=this.mix(t,e),o=I(i.r,i.g,i.b,i.a);return r?w.HSL(o):rt.HSLA(i,n)},f),at=function(t,r){return e({r:k(t.r,r),g:k(t.g,r),b:k(t.b,r)},B(t,"a")?{a:k(t.a,r)}:{})},ut=function(t,r){return e({h:k(t.h,r),s:k(t.s,r),l:k(t.l,r)},B(t,"a")?{a:k(t.a,r)}:{})},ct=function(t,e){return{c:k(t.c,e),m:k(t.m,e),y:k(t.y,e),k:k(t.k,e)}},st=function(t,e,r,n,i,o){var a=i(et(t,e),n);return r?o(a):a},dt=function(t,e,r,n,i,o,a){r<1&&(r=5);var u=function(t,e,r){var n=r-1,i=(e.r-t.r)/n,o=(e.g-t.g)/n,a=(e.b-t.b)/n,u=V(t.a),c=(V(e.a)-u)/n;return Array(r).fill(null).map((function(r,s){return 0===s?t:s===n?e:{r:k(t.r+i*s),g:k(t.g+o*s),b:k(t.b+a*s),a:k(u+c*s)}}))}(et(t),et(e),r);return u.map((function(t){var e=o(t,i);return n?a(e):e}))},ht=function(){function r(t,e){void 0===e&&(e=6),this.rgb=et(t),this._decimals=e,this.updateHSL(),this.updateCMYK()}return r.prototype.updateRGB=function(){this.rgb=e(e({},Y(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},r.prototype.updateRGBFromCMYK=function(){this.rgb=e(e({},j(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},r.prototype.updateHSL=function(){this.hsl=I(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},r.prototype.updateCMYK=function(){this.cmyk=K(this.rgb.r,this.rgb.g,this.rgb.b)},r.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},r.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},r.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},r.prototype.setDecimals=function(t){return this._decimals=t,this},r.prototype.setH=function(t){return this.hsl.h=N(t),this.updateRGBAndCMYK()},r.prototype.setS=function(t){return this.hsl.s=O(t,0,100),this.updateRGBAndCMYK()},r.prototype.setL=function(t){return this.hsl.l=O(t,0,100),this.updateRGBAndCMYK()},r.prototype.setR=function(t){return this.rgb.r=O(t,0,255),this.updateHSLAndCMYK()},r.prototype.setG=function(t){return this.rgb.g=O(t,0,255),this.updateHSLAndCMYK()},r.prototype.setB=function(t){return this.rgb.b=O(t,0,255),this.updateHSLAndCMYK()},r.prototype.setA=function(t){return this.hsl.a=this.rgb.a=O(t,0,1),this},r.prototype.setC=function(t){return this.cmyk.c=O(t,0,100),this.updateRGBAndHSL()},r.prototype.setM=function(t){return this.cmyk.m=O(t,0,100),this.updateRGBAndHSL()},r.prototype.setY=function(t){return this.cmyk.y=O(t,0,100),this.updateRGBAndHSL()},r.prototype.setK=function(t){return this.cmyk.k=O(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(r.prototype,"decimals",{get:function(){return this._decimals},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"H",{get:function(){return k(this.hsl.h,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"S",{get:function(){return k(this.hsl.s,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"L",{get:function(){return k(this.hsl.l,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"R",{get:function(){return k(this.rgb.r,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"G",{get:function(){return k(this.rgb.g,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"B",{get:function(){return k(this.rgb.b,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"A",{get:function(){return k(this.hsl.a,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"C",{get:function(){return k(this.cmyk.c,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"M",{get:function(){return k(this.cmyk.m,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Y",{get:function(){return k(this.cmyk.y,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"K",{get:function(){return k(this.cmyk.k,this.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXObject",{get:function(){return rt.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXAObject",{get:function(){return rt.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBAObject",{get:function(){return e(e({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLAObject",{get:function(){return e(e({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKAObject",{get:function(){return e(e({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEX",{get:function(){return w.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXA",{get:function(){return w.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGB",{get:function(){return w.RGB({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBA",{get:function(){return w.RGB({r:this.R,g:this.G,b:this.B,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSL",{get:function(){return w.HSL({h:this.H,s:this.S,l:this.L})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLA",{get:function(){return w.HSL({h:this.H,s:this.S,l:this.L,a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYK",{get:function(){return w.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKA",{get:function(){return w.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A})},enumerable:!1,configurable:!0}),r.toHEX=function(t,e){void 0===e&&(e=!0);var r=W(t);return st(t,r,e,0,rt.HEX,w.HEX)},r.toHEXA=function(t,e){void 0===e&&(e=!0);var r=W(t);return st(t,r,e,0,rt.HEXA,w.HEX)},r.toRGB=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.RGB,w.RGB)},r.toRGBA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.RGBA,w.RGB)},r.toHSL=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.HSL,w.HSL)},r.toHSLA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.HSLA,w.HSL)},r.toCMYK=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.CMYK,w.CMYK)},r.toCMYKA=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=6);var n=W(t);return st(t,n,e,r,rt.CMYKA,w.CMYK)},r.getBlendHEX=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.HEX,w.HEX)},r.getBlendHEXA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.HEXA,w.HEX)},r.getBlendRGB=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.RGB,w.RGB)},r.getBlendRGBA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.RGBA,w.RGB)},r.getBlendHSL=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.HSL,w.HSL)},r.getBlendHSLA=function(t,e,r,n,i){return void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=6),dt(t,e,r,n,i,rt.HSLA,w.HSL)},r.getMixHEX=function(e,r,n){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),ot.HEX(e,r,n)},r.getMixHEXA=function(e,r,n){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),ot.HEXA(e,r,n)},r.getMixRGB=function(e,r,n,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),void 0===i&&(i=6),ot.RGB(e,r,n,i)},r.getMixRGBA=function(e,r,n,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),void 0===i&&(i=6),ot.RGBA(e,r,n,i)},r.getMixHSL=function(e,r,n,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),void 0===i&&(i=6),ot.HSL(e,r,n,i)},r.getMixHSLA=function(e,r,n,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===n&&(n=!0),void 0===i&&(i=6),ot.HSLA(e,r,n,i)},r.getShades=function(t,e,r){return void 0===r&&(r=6),nt(t,e,!0,r)},r.getTints=function(t,e,r){return void 0===r&&(r=6),nt(t,e,!1,r)},r.getHarmony=function(e,r,n,i){return void 0===r&&(r=t.Harmony.COMPLEMENTARY),void 0===n&&(n=t.Mix.ADDITIVE),void 0===i&&(i=6),function(e,r,n,i){var o;return(o={},o[t.Harmony.ANALOGOUS]=it.buildHarmony(r,q,i,n),o[t.Harmony.COMPLEMENTARY]=it.buildHarmony(r,$,i,n),o[t.Harmony.SPLIT_COMPLEMENTARY]=it.buildHarmony(r,_,i,n),o[t.Harmony.TRIADIC]=it.buildHarmony(r,Q,i,n),o[t.Harmony.TETRADIC]=it.buildHarmony(r,z,i,n),o[t.Harmony.SQUARE]=it.buildHarmony(r,J,i,n),o)[e]}(r,e,i,n)},r}();return t.ColorTranslator=ht,t}({});
var colortranslator=function(t){"use strict";var e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};function n(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var r,i,o,a;!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(r||(r={})),t.Harmony=void 0,(i=t.Harmony||(t.Harmony={})).ANALOGOUS="ANALOGOUS",i.COMPLEMENTARY="COMPLEMENTARY",i.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",i.TRIADIC="TRIADIC",i.TETRADIC="TETRADIC",i.SQUARE="SQUARE",t.Mix=void 0,(o=t.Mix||(t.Mix={})).ADDITIVE="ADDITIVE",o.SUBTRACTIVE="SUBTRACTIVE",function(t){t.black="#000000",t.silver="#C0C0C0",t.gray="#808080",t.white="#FFFFFF",t.maroon="#800000",t.red="#FF0000",t.purple="#800080",t.fuchsia="#FF00FF",t.green="#008000",t.lime="#00FF00",t.olive="#808000",t.yellow="#FFFF00",t.navy="#000080",t.blue="#0000FF",t.teal="#008080",t.aqua="#00FFFF",t.orange="#FFA500",t.aliceblue="#F0F8FF",t.antiquewhite="#FAEBD7",t.aquamarine="#7FFFD4",t.azure="#F0FFFF",t.beige="#F5F5DC",t.bisque="#FFE4C4",t.blanchedalmond="#FFEBCD",t.blueviolet="#8A2BE2",t.brown="#A52A2A",t.burlywood="#DEB887",t.cadetblue="#5F9EA0",t.chartreuse="#7FFF00",t.chocolate="#D2691E",t.coral="#FF7F50",t.cornflowerblue="#6495ED",t.cornsilk="#FFF8DC",t.crimson="#DC143C",t.cyan="#00FFFF",t.darkblue="#00008B",t.darkcyan="#008B8B",t.darkgoldenrod="#B8860B",t.darkgray="#A9A9A9",t.darkgreen="#006400",t.darkgrey="#A9A9A9",t.darkkhaki="#BDB76B",t.darkmagenta="#8B008B",t.darkolivegreen="#556B2F",t.darkorange="#FF8C00",t.darkorchid="#9932CC",t.darkred="#8B0000",t.darksalmon="#E9967A",t.darkseagreen="#8FBC8F",t.darkslateblue="#483D8B",t.darkslategray="#2F4F4F",t.darkslategrey="#2F4F4F",t.darkturquoise="#00CED1",t.darkviolet="#9400D3",t.deeppink="#FF1493",t.deepskyblue="#00BFFF",t.dimgray="#696969",t.dimgrey="#696969",t.dodgerblue="#1E90FF",t.firebrick="#B22222",t.floralwhite="#FFFAF0",t.forestgreen="#228B22",t.gainsboro="#DCDCDC",t.ghostwhite="#F8F8FF",t.gold="#FFD700",t.goldenrod="#DAA520",t.greenyellow="#ADFF2F",t.grey="#808080",t.honeydew="#F0FFF0",t.hotpink="#FF69B4",t.indianred="#CD5C5C",t.indigo="#4B0082",t.ivory="#FFFFF0",t.khaki="#F0E68C",t.lavender="#E6E6FA",t.lavenderblush="#FFF0F5",t.lawngreen="#7CFC00",t.lemonchiffon="#FFFACD",t.lightblue="#ADD8E6",t.lightcoral="#F08080",t.lightcyan="#E0FFFF",t.lightgoldenrodyellow="#FAFAD2",t.lightgray="#D3D3D3",t.lightgreen="#90EE90",t.lightgrey="#D3D3D3",t.lightpink="#FFB6C1",t.lightsalmon="#FFA07A",t.lightseagreen="#20B2AA",t.lightskyblue="#87CEFA",t.lightslategray="#778899",t.lightslategrey="#778899",t.lightsteelblue="#B0C4DE",t.lightyellow="#FFFFE0",t.limegreen="#32CD32",t.linen="#FAF0E6",t.magenta="#FF00FF",t.mediumaquamarine="#66CDAA",t.mediumblue="#0000CD",t.mediumorchid="#BA55D3",t.mediumpurple="#9370DB",t.mediumseagreen="#3CB371",t.mediumslateblue="#7B68EE",t.mediumspringgreen="#00FA9A",t.mediumturquoise="#48D1CC",t.mediumvioletred="#C71585",t.midnightblue="#191970",t.mintcream="#F5FFFA",t.mistyrose="#FFE4E1",t.moccasin="#FFE4B5",t.navajowhite="#FFDEAD",t.oldlace="#FDF5E6",t.olivedrab="#6B8E23",t.orangered="#FF4500",t.orchid="#DA70D6",t.palegoldenrod="#EEE8AA",t.palegreen="#98FB98",t.paleturquoise="#AFEEEE",t.palevioletred="#DB7093",t.papayawhip="#FFEFD5",t.peachpuff="#FFDAB9",t.peru="#CD853F",t.pink="#FFC0CB",t.plum="#DDA0DD",t.powderblue="#B0E0E6",t.rosybrown="#BC8F8F",t.royalblue="#4169E1",t.saddlebrown="#8B4513",t.salmon="#FA8072",t.sandybrown="#F4A460",t.seagreen="#2E8B57",t.seashell="#FFF5EE",t.sienna="#A0522D",t.skyblue="#87CEEB",t.slateblue="#6A5ACD",t.slategray="#708090",t.slategrey="#708090",t.snow="#FFFAFA",t.springgreen="#00FF7F",t.steelblue="#4682B4",t.tan="#D2B48C",t.thistle="#D8BFD8",t.tomato="#FF6347",t.turquoise="#40E0D0",t.violet="#EE82EE",t.wheat="#F5DEB3",t.whitesmoke="#F5F5F5",t.yellowgreen="#9ACD32",t.rebeccapurple="#663399"}(a||(a={}));var c,u,s=Object.keys(a),l={HEX:["r","g","b","a"],RGB:["r","g","b","a"],HSL:["h","s","l","a"],CMYK:["c","m","y","k","a"]},d={BGR:r.RGB,ABGR:r.RGB,HLS:r.HSL,AHLS:r.HSL,CKMY:r.CMYK,ACKMY:r.CMYK};!function(t){t.NUMBER="number",t.BOOLEAN="boolean"}(c||(c={}));var f,h,p,g=((u={})[r.HEX]=/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,u[r.RGB]=/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u[r.HSL]=/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u[r.CMYK]=/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,u),m=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,y=/^0x([a-f\d]{1,2})$/i,A=/\{(\d+)\}/g,E=/,( +|\d+)/g,F=/ +/,v="The provided string color doesn't have a correct format",H="The provided color object doesn't have the proper keys or format";!function(t){t.NONE="none",t.DEGREES="deg",t.GRADIANS="grad",t.RADIANS="rad",t.TURNS="turn"}(f||(f={})),function(t){t.NONE="none",t.PERCENT="percent"}(h||(h={})),function(t){t.DEVICE_CMYK="device-cmyk",t.CMYK="cmyk"}(p||(p={}));var B,C,S,M,R,D,O={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:f.NONE,rgbUnit:h.NONE,cmykUnit:h.PERCENT,alphaUnit:h.NONE,cmykFunction:p.DEVICE_CMYK},L=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},G=function(t){return+"".concat(t).replace(b,"$1")},k=function(t){return b.test("".concat(t))?G(t):Math.min(+t,100)},j=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},X=function(t){var e=K(t,0).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},I=function(t,e){return void 0===e&&(e=!1),!e&&b.test(t)?Math.min(255*G(t)/100,255):y.test(t)?(3===t.length&&(t+=t.slice(-1)),e?K(t)/255:K(t)):Math.min(+t,e?1:255)},Y=function(t){return Math.min(b.test(t)?G(t)/100:+t,1)},T=function(t){return n([],t,!0).sort().join("").toUpperCase()},K=function(t,e){void 0===e&&(e=6);var n=Math.pow(10,e);return Math.round(+t*n)/n},N=function(t,e,n){return Math.max(e,Math.min(t,n))},x=360,P=function(t){if("string"==typeof t){var e=t.match(m),n=+e[1];switch(e[2]){case f.RADIANS:t=K(180*n/Math.PI);break;case f.TURNS:t=K(n*x);break;case f.GRADIANS:t=K(.9*n);break;case f.DEGREES:default:t=n}}return(t>360||t<0)&&(t-=Math.floor(t/x)*x),t},U=function(t,e){var n;switch(e){case f.RADIANS:n=K(function(t){return t*Math.PI/180}(t));break;case f.TURNS:n=K(t/x);break;case f.GRADIANS:n=K(10/9*t);break;case f.DEGREES:case f.NONE:default:n=t}return n},w=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=[],i=[],o=[],a=[],u=[],s=Object.values(f),l=Object.values(h),d=Object.values(p),y={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0},A=0,v=e;A<v.length;A++){var H=v[A];if("string"==typeof H){if(r.push(H),H.includes(",")){y.legacyCSS++;var B=H.match(E);1===new Set(B).size&&F.test(B[0].slice(1))&&y.spacesAfterCommas++}if(H.match(g.HSL)){var C=(k=H.match(g.HSL))[1]||k[5],S=k[8],M=C.match(m)[2];i.push(""===M?f.NONE:M),u.push(b.test(S));continue}if(g.RGB.test(H)){var R=(k=H.match(g.RGB))[1]||k[5],D=k[2]||k[6],L=k[3]||k[7],G=k[8];o.push(b.test(R)&&b.test(D)&&b.test(L)),u.push(b.test(G));continue}if(H.match(g.CMYK)){var k,j=(k=H.match(g.CMYK))[1]||k[6],X=k[2]||k[7],I=k[3]||k[8],Y=k[4]||k[9];G=k[10];a.push(b.test(j)&&b.test(X)&&b.test(I)&&b.test(Y)),H.startsWith("cmyk")&&y.cmykFunction++,u.push(b.test(G))}}}return{decimals:typeof t.decimals===c.NUMBER?t.decimals:O.decimals,legacyCSS:typeof t.legacyCSS===c.BOOLEAN?t.legacyCSS:Boolean(r.length&&y.legacyCSS===r.length)||O.legacyCSS,spacesAfterCommas:typeof t.spacesAfterCommas===c.BOOLEAN?t.spacesAfterCommas:Boolean(r.length&&y.spacesAfterCommas===r.length)||O.spacesAfterCommas,anglesUnit:t.anglesUnit&&s.includes(t.anglesUnit)?t.anglesUnit:1===new Set(i).size?i[0]:O.anglesUnit,rgbUnit:t.rgbUnit&&l.includes(t.rgbUnit)?t.rgbUnit:1===new Set(o).size&&o[0]?h.PERCENT:O.rgbUnit,cmykUnit:t.cmykUnit&&l.includes(t.cmykUnit)?t.cmykUnit:1!==new Set(a).size||a[0]?O.cmykUnit:h.NONE,alphaUnit:t.alphaUnit&&l.includes(t.alphaUnit)?t.alphaUnit:1===new Set(u).size&&u[0]?h.PERCENT:O.alphaUnit,cmykFunction:t.cmykFunction&&d.includes(t.cmykFunction)?t.cmykFunction:a.length&&a.length===y.cmykFunction?p.CMYK:O.cmykFunction}},V=function(t,e,n){return n<0&&(n+=6),n>=6&&(n-=6),K(n<1?255*((e-t)*n+t):n<3?255*e:n<4?255*((e-t)*(4-n)+t):255*t)},q=function(t,e,n){e/=100;var r=(n/=100)<=.5?n*(e+1):n+e-n*e,i=2*n-r;return{r:V(i,r,(t/=60)+2),g:V(i,r,t),b:V(i,r,t-2)}},_=function(t,e,n,r){return{r:K(255*(1-t)*(r=1-r)),g:K(255*(1-e)*r),b:K(255*(1-n)*r)}},$=function(t,e,n){t/=255,e/=255,n/=255;var r=1-Math.max(t,e,n),i=1-r,o=i&&(i-e)/i,a=i&&(i-n)/i;return{c:K(100*(i&&(i-t)/i)),m:K(100*o),y:K(100*a),k:K(100*r)}},z=function(t,e,n,r){void 0===r&&(r=1),t/=255,e/=255,n/=255,r=Math.min(r,1);var i=Math.max(t,e,n),o=Math.min(t,e,n),a=i-o,c=0,u=0,s=(i+o)/2;if(0!==a){switch(i){case t:c=(e-n)/a%6;break;case e:c=(n-t)/a+2;break;case n:c=(t-e)/a+4}(c=K(60*c))<0&&(c+=360),u=a/(1-Math.abs(2*s-1))}return{h:c,s:K(100*u),l:K(100*s),a:r}},Q=function(t,e){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var n=[[0,120],[120,180],[180,240],[240,360]],r=[[0,60],[60,120],[120,240],[240,360]],i=e?r:n,o=0,a=0,c=0,u=0;return(e?n:r).find((function(e,n){return t>=e[0]&&t<e[1]&&(o=e[0],a=e[1],c=i[n][0],u=i[n][1],!0)})),c+(u-c)/(a-o)*(t-o)},W=function(t){return t?", ":","},J=function(t,e){var n=T(Object.keys(t));return l[d[n]].reduce((function(n,r,i){var o=t[r];return void 0!==o&&n.push(e(o,i)),n}),[])},Z=function(t,e){return t.replace(A,(function(t,n){return"".concat(e[+n-1])}))},tt=function(t,e){var n=e.alphaUnit,r=e.legacyCSS,i=e.decimals;return n!==h.PERCENT||r?K(t,i):"".concat(K(100*t,i),"%")},et=((B={})[r.HEX]=function(t){var e=J(t,(function(t){return e=K(t),1===(n=K(e,0).toString(16).toUpperCase()).length&&(n="0".concat(n)),n;var e,n})),n=4===e.length?"#{1}{2}{3}{4}":"#{1}{2}{3}";return Z(n,e)},B[r.RGB]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.rgbUnit,a=W(i),c=J(t,(function(t,r){return o===h.PERCENT&&r<3?"".concat(function(t,e){return K(t/255*100,e)}(t,n),"%"):3===r?tt(t,e):K(t,n)})),u=r?4===c.length?"rgba({1}".concat(a,"{2}").concat(a,"{3}").concat(a,"{4})"):"rgb({1}".concat(a,"{2}").concat(a,"{3})"):4===c.length?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return Z(u,c)},B[r.HSL]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.anglesUnit,a=W(i),c=J(t,(function(t,r){if(0===r&&o!==f.NONE){var i=K(U(t,o),n);return"".concat(i).concat(o)}return 3===r?tt(t,e):K(t,n)})),u=r?4===c.length?"hsla({1}".concat(a,"{2}%").concat(a,"{3}%").concat(a,"{4})"):"hsl({1}".concat(a,"{2}%").concat(a,"{3}%)"):4===c.length?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return Z(u,c)},B[r.CMYK]=function(t,e){var n=e.decimals,r=e.legacyCSS,i=e.spacesAfterCommas,o=e.cmykUnit,a=e.cmykFunction,c=W(i),u=J(t,(function(t,r){return o===h.PERCENT&&r<4?"".concat(K(t,n),"%"):4===r?tt(t,e):K(t/100,n)})),s=r?5===u.length?"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4}").concat(c,"{5})"):"".concat(a,"({1}").concat(c,"{2}").concat(c,"{3}").concat(c,"{4})"):5===u.length?"".concat(a,"({1} {2} {3} {4} / {5})"):"".concat(a,"({1} {2} {3} {4})");return Z(s,u)},B),nt=function(t){return"string"==typeof t&&(t=b.test(t)?G(t)/100:+t),isNaN(+t)||t>1?1:K(t)},rt=function(r,i,o){return i.reduce((function(i,a){return n(n([],i,!0),[e(e({},r),{h:o===t.Mix.ADDITIVE?P(r.h+a):P(Q(Q(r.h,!1)+a,!0))})],!1)}),[e({},r)])},it=function(t,e){return rt(t,[30,-30],e)},ot=function(t,e){return rt(t,[180],e)},at=function(t,e){return rt(t,[150,-150],e)},ct=function(t,e){return rt(t,[120,-120],e)},ut=function(t,e){return rt(t,[60,-120,180],e)},st=function(t,e){return rt(t,[90,-90,180],e)},lt=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(r).some((function(n){if(g[n].test(t))return e=n,!0})),!e&&~s.indexOf(t)&&(e=r.HEX),!e)throw new Error(v);return e}(t):function(t){var e,n=!1,i=T(Object.keys(t));if(d[i]&&(e=d[i]),e&&e===r.RGB){var o=Object.entries(t).some((function(t){return!y.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(b.test("".concat(t[1]))||!y.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));o&&a&&(n=!0),o||(e=r.HEX)}if(!e||n)throw new Error(H);return e}(t)},dt=((C={})[r.HEX]=function(t){var e=(~s.indexOf(t)?a[t]:t).match(g.HEX),n={r:j(e[1]||e[5]),g:j(e[2]||e[6]),b:j(e[3]||e[7])},r=e[4]||e[8];return void 0!==r&&(n.a=j(r)/255),n},C[r.RGB]=function(t){var e=t.match(g.RGB),n=I(e[1]||e[5]),r=I(e[2]||e[6]),i=I(e[3]||e[7]),o=e[4]||e[8],a={r:Math.min(n,255),g:Math.min(r,255),b:Math.min(i,255)};return void 0!==o&&(a.a=nt(o)),a},C[r.HSL]=function(t){var e=t.match(g.HSL),n=P(e[1]||e[5]),r=k(e[2]||e[6]),i=k(e[3]||e[7]),o=e[4]||e[8],a=q(n,r,i);return void 0!==o&&(a.a=nt(o)),a},C[r.CMYK]=function(t){var e=t.match(g.CMYK),n=Y(e[1]||e[6]),r=Y(e[2]||e[7]),i=Y(e[3]||e[8]),o=Y(e[4]||e[9]),a=e[5]||e[10],c=_(n,r,i,o);return void 0!==a&&(c.a=nt(a)),c},C),ft=((S={})[r.HEX]=function(t){var e={r:I("".concat(t.r)),g:I("".concat(t.g)),b:I("".concat(t.b))};return L(t,"a")&&(e.a=Math.min(I("".concat(t.a),!0),1)),e},S[r.RGB]=function(t){return this.HEX(t)},S[r.HSL]=function(t){var e=k("".concat(t.s)),n=k("".concat(t.l)),r=q(P(t.h),e,n);return L(t,"a")&&(r.a=nt(t.a)),r},S[r.CMYK]=function(t){var e=Y("".concat(t.c)),n=Y("".concat(t.m)),r=Y("".concat(t.y)),i=Y("".concat(t.k)),o=_(e,n,r,i);return L(t,"a")&&(o.a=nt(t.a)),o},S),ht=function(t,e){return void 0===e&&(e=lt(t)),"string"==typeof t?dt[e](t):ft[e](t)},pt=((M={})[r.HEX]=function(t){return{r:X(t.r),g:X(t.g),b:X(t.b)}},M.HEXA=function(t){var e=pt.HEX(t);return e.a=L(t,"a")?X(255*t.a):"0xFF",e},M[r.RGB]=function(t,e){var n=yt(t,e);return L(n,"a")&&delete n.a,n},M.RGBA=function(t,e){var n=pt.RGB(t,e);return n.a=L(t,"a")?K(t.a):1,n},M[r.HSL]=function(t,e){var n=z(t.r,t.g,t.b);return delete n.a,At(n,e)},M.HSLA=function(t,e){var n=pt.HSL(t,e);return n.a=L(t,"a")?K(t.a,e):1,n},M[r.CMYK]=function(t,e){return Et($(t.r,t.g,t.b),e)},M.CMYKA=function(t,e){var n=pt.CMYK(t,e);return n.a=L(t,"a")?K(t.a,e):1,n},M),gt=function(t,n,i,o){var a=lt(t),c="string"==typeof t,u=ht(t,a),s="string"==typeof t&&L(u,"a")||"string"!=typeof t&&L(t,"a"),l=z(u.r,u.g,u.b,u.a);s||delete l.a;var d=i?l.l/(n+1):(100-l.l)/(n+1),f=Array(n).fill(null).map((function(t,n){return e(e({},l),{l:l.l+d*(n+1)*(1-2*+i)})}));switch(a){case r.HEX:default:return f.map((function(t){var n=q(t.h,t.s,t.l);return s&&(n.a=t.a),c?s?et.HEX(e(e({},n),{a:K(255*n.a)})):et.HEX(n):s?pt.HEXA(n):pt.HEX(n)}));case r.RGB:return f.map((function(t){var e=q(t.h,t.s,t.l);return s&&(e.a=t.a),c?et.RGB(e,o):s?pt.RGBA(e,o.decimals):pt.RGB(e,o.decimals)}));case r.HSL:return f.map((function(t){return c?et.HSL(t,o):s?pt.HSLA(e(e({},q(t.h,t.s,t.l)),{a:t.a}),o.decimals):pt.HSL(q(t.h,t.s,t.l),o.decimals)}))}},mt=((R={buildHarmony:function(t,e,n,i){var o=lt(t),a=ht(t,o),c=z(a.r,a.g,a.b,a.a),u="string"==typeof t&&L(a,"a")||"string"!=typeof t&&L(t,"a"),s="string"==typeof t;switch(o){case r.HEX:default:return u?this.HEXA(At(c,0),e,n,s):this.HEX(At(c,0),e,n,s);case r.HSL:return u?this.HSLA(c,e,n,s,i):this.HSL(c,e,n,s,i);case r.RGB:return u?this.RGBA(c,e,n,s,i):this.RGB(c,e,n,s,i)}}})[r.HEX]=function(t,e,n,r){return e(t,n).map((function(t){return r?et.HEX(q(t.h,t.s,t.l)):pt.HEX(q(t.h,t.s,t.l))}))},R.HEXA=function(t,n,r,i){return n(t,r).map((function(t){return i?et.HEX(e(e({},q(t.h,t.s,t.l)),{a:255*nt(t.a)})):pt.HEXA(e(e({},q(t.h,t.s,t.l)),{a:nt(t.a)}))}))},R[r.RGB]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?et.RGB(q(t.h,t.s,t.l),i):pt.RGB(q(t.h,t.s,t.l),i.decimals)}))},R.RGBA=function(t,n,r,i,o){return n(t,r).map((function(t){return i?et.RGB(e(e({},q(t.h,t.s,t.l)),{a:nt(t.a)}),o):pt.RGBA(e(e({},q(t.h,t.s,t.l)),{a:nt(t.a)}),o.decimals)}))},R[r.HSL]=function(t,e,n,r,i){return e(t,n).map((function(t){return r?et.HSL({h:t.h,s:t.s,l:t.l},i):pt.HSL(q(t.h,t.s,t.l),i.decimals)}))},R.HSLA=function(t,n,r,i,o){return n(t,r).map((function(t){return i?et.HSL(e(e({},t),{a:nt(t.a)}),o):pt.HSLA(e(e({},q(t.h,t.s,t.l)),{a:nt(t.a)}),o.decimals)}))},R),bt=((D={mix:function(n,r){var i,o,a,c,u,s,l,d,f,h,p,g,m,b,y,A=n.map((function(t){var e=lt(t);return ht(t,e)})),E=r===t.Mix.SUBTRACTIVE?A.map((function(t){var e,n,r,i,o,a,c,u,s,l,d,f,h,p,g=(e=t.r,n=t.g,r=t.b,i=Math.min(e,n,r),o=Math.min(255-e,255-n,255-r),a=e-i,c=n-i,u=r-i,s=Math.min(a,c),l=a-s,d=(c+s)/2,f=(u+c-s)/2,h=Math.max(l,d,f)/Math.max(a,c,u),p=isNaN(h)||h===1/0||h<=0?1:h,{r:l/p+o,y:d/p+o,b:f/p+o});return L(t,"a")&&(g.a=t.a),g})):null;function F(n){var i=r===t.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return n.reduce((function(n,i){var o=L(i,"a")?i.a:1,a={r:Math.min(n.r+i.r*o,255),b:Math.min(n.b+i.b*o,255),a:1-(1-o)*(1-n.a)},c="g"in n?n.g:n.y,u="g"in i?i.g:i.y;return e(e({},a),r===t.Mix.ADDITIVE?{g:Math.min(c+u*o,255)}:{y:Math.min(c+u*o,255)})}),i)}if(r===t.Mix.ADDITIVE)i=F(A);else{var v=F(E);o=v.r,a=v.y,c=v.b,u=Math.min(o,a,c),s=Math.min(255-o,255-a,255-c),l=o-u,d=a-u,f=c-u,h=Math.min(d,f),p=l+d-h,g=d+h,m=2*(f-h),b=Math.max(p,g,m)/Math.max(l,d,f),y=isNaN(b)||b===1/0||b<=0?1:b,(i={r:p/y+s,g:g/y+s,b:m/y+s}).a=v.a}return{r:K(i.r),g:K(i.g),b:K(i.b),a:N(i.a,0,1)}}})[r.HEX]=function(t,e,n){var r=this.mix(t,e);return delete r.a,n?et.HEX(r):pt.HEX(r)},D.HEXA=function(t,e,n){var r=this.mix(t,e);return r.a=n?255*nt(r.a):nt(r.a),n?et.HEX(r):pt.HEXA(r)},D[r.RGB]=function(t,e,n,r){var i=this.mix(t,e);return delete i.a,n?et.RGB(i,r):pt.RGB(i,r.decimals)},D.RGBA=function(t,e,n,r){var i=this.mix(t,e);return n?et.RGB(i,r):pt.RGBA(i,r.decimals)},D[r.HSL]=function(t,e,n,r){var i=this.mix(t,e),o=z(i.r,i.g,i.b);return delete i.a,delete o.a,n?et.HSL(o,r):pt.HSL(i,r.decimals)},D.HSLA=function(t,e,n,r){var i=this.mix(t,e),o=z(i.r,i.g,i.b,i.a);return n?et.HSL(o,r):pt.HSLA(i,r.decimals)},D),yt=function(t,n){var r=K(t.r,n),i=K(t.g,n),o=K(t.b,n);return e({r:r,g:i,b:o},L(t,"a")?{a:K(t.a,n)}:{})},At=function(t,n){return e({h:K(t.h,n),s:K(t.s,n),l:K(t.l,n)},L(t,"a")?{a:K(t.a,n)}:{})},Et=function(t,e){return{c:K(t.c,e),m:K(t.m,e),y:K(t.y,e),k:K(t.k,e)}},Ft=function(t,e,n,r){return r(ht(t,e),n)},vt=function(t,e,n,r,i){n<1&&(n=5);var o=function(t,e,n){var r=n-1,i=(e.r-t.r)/r,o=(e.g-t.g)/r,a=(e.b-t.b)/r,c=nt(t.a),u=(nt(e.a)-c)/r;return Array(n).fill(null).map((function(n,s){return 0===s?t:s===r?e:{r:K(t.r+i*s),g:K(t.g+o*s),b:K(t.b+a*s),a:K(c+u*s)}}))}(ht(t),ht(e),n);return o.map((function(t){return i(t,r)}))},Ht=function(){function r(t,e){void 0===e&&(e={}),this._options=w(e,t),this.rgb=ht(t),this.updateHSL(),this.updateCMYK()}return r.prototype.updateRGB=function(){this.rgb=e(e({},q(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},r.prototype.updateRGBFromCMYK=function(){this.rgb=e(e({},_(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},r.prototype.updateHSL=function(){this.hsl=z(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},r.prototype.updateCMYK=function(){this.cmyk=$(this.rgb.r,this.rgb.g,this.rgb.b)},r.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},r.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},r.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},r.prototype.setOptions=function(t){return void 0===t&&(t={}),this._options=e(e({},this._options),t),this},r.prototype.setH=function(t){return this.hsl.h=P(t),this.updateRGBAndCMYK()},r.prototype.setS=function(t){return this.hsl.s=N(t,0,100),this.updateRGBAndCMYK()},r.prototype.setL=function(t){return this.hsl.l=N(t,0,100),this.updateRGBAndCMYK()},r.prototype.setR=function(t){return this.rgb.r=N(t,0,255),this.updateHSLAndCMYK()},r.prototype.setG=function(t){return this.rgb.g=N(t,0,255),this.updateHSLAndCMYK()},r.prototype.setB=function(t){return this.rgb.b=N(t,0,255),this.updateHSLAndCMYK()},r.prototype.setA=function(t){return this.hsl.a=this.rgb.a=N(t,0,1),this},r.prototype.setC=function(t){return this.cmyk.c=N(t,0,100),this.updateRGBAndHSL()},r.prototype.setM=function(t){return this.cmyk.m=N(t,0,100),this.updateRGBAndHSL()},r.prototype.setY=function(t){return this.cmyk.y=N(t,0,100),this.updateRGBAndHSL()},r.prototype.setK=function(t){return this.cmyk.k=N(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(r.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"H",{get:function(){return K(this.hsl.h,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"S",{get:function(){return K(this.hsl.s,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"L",{get:function(){return K(this.hsl.l,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"R",{get:function(){return K(this.rgb.r,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"G",{get:function(){return K(this.rgb.g,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"B",{get:function(){return K(this.rgb.b,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"A",{get:function(){return K(this.hsl.a,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"C",{get:function(){return K(this.cmyk.c,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"M",{get:function(){return K(this.cmyk.m,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Y",{get:function(){return K(this.cmyk.y,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"K",{get:function(){return K(this.cmyk.k,this.options.decimals)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXObject",{get:function(){return pt.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXAObject",{get:function(){return pt.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBAObject",{get:function(){return e(e({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLAObject",{get:function(){return e(e({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKAObject",{get:function(){return e(e({},this.CMYKObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEX",{get:function(){return et.HEX({r:this.R,g:this.G,b:this.B})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXA",{get:function(){return et.HEX({r:this.R,g:this.G,b:this.B,a:255*this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGB",{get:function(){return et.RGB({r:this.R,g:this.G,b:this.B},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBA",{get:function(){return et.RGB({r:this.R,g:this.G,b:this.B,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSL",{get:function(){return et.HSL({h:this.H,s:this.S,l:this.L},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLA",{get:function(){return et.HSL({h:this.H,s:this.S,l:this.L,a:this.A},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYK",{get:function(){return et.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K},this.options)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKA",{get:function(){return et.CMYK({c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A},this.options)},enumerable:!1,configurable:!0}),r.toHEXObject=function(t){var e=lt(t);return Ft(t,e,0,pt.HEX)},r.toHEX=function(t){return et.HEX(r.toHEXObject(t))},r.toHEXAObject=function(t){var e=lt(t);return Ft(t,e,0,pt.HEXA)},r.toHEXA=function(t){return et.HEX(r.toHEXAObject(t))},r.toRGBObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.RGB)},r.toRGB=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.RGB);return et.RGB(i,r)},r.toRGBAObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.RGBA)},r.toRGBA=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.RGBA);return et.RGB(i,r)},r.toHSLObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.HSL)},r.toHSL=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.HSL);return et.HSL(i,r)},r.toHSLAObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.HSLA)},r.toHSLA=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.HSLA);return et.HSL(i,r)},r.toCMYKObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.CMYK)},r.toCMYK=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.CMYK);return et.CMYK(i,r)},r.toCMYKAObject=function(t,e){void 0===e&&(e={});var n=lt(t);return Ft(t,n,e.decimals,pt.CMYKA)},r.toCMYKA=function(t,e){void 0===e&&(e={});var n=lt(t),r=w(e,t),i=Ft(t,n,6,pt.CMYKA);return et.CMYK(i,r)},r.getBlendHEXObject=function(t,e,n){return void 0===n&&(n=5),vt(t,e,n,0,pt.HEX)},r.getBlendHEX=function(t,e,n){return void 0===n&&(n=5),r.getBlendHEXObject(t,e,n).map((function(t){return et.HEX(t)}))},r.getBlendHEXAObject=function(t,e,n){return void 0===n&&(n=5),vt(t,e,n,0,pt.HEXA)},r.getBlendHEXA=function(t,e,n){return void 0===n&&(n=5),r.getBlendHEXAObject(t,e,n).map((function(t){return et.HEX(t)}))},r.getBlendRGBObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),vt(t,e,n,r.decimals,pt.RGB)},r.getBlendRGB=function(t,e,n,i){return void 0===n&&(n=5),void 0===i&&(i={}),r.getBlendRGBObject(t,e,n,i).map((function(n){return et.RGB(n,w(i,t,e))}))},r.getBlendRGBAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),vt(t,e,n,r.decimals,pt.RGBA)},r.getBlendRGBA=function(t,e,n,i){return void 0===n&&(n=5),void 0===i&&(i={}),r.getBlendRGBAObject(t,e,n,i).map((function(n){return et.RGB(n,w(i,t,e))}))},r.getBlendHSLObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),vt(t,e,n,r.decimals,pt.HSL)},r.getBlendHSL=function(t,e,n,i){void 0===n&&(n=5),void 0===i&&(i={});var o=w(i,t,e);return r.getBlendHSLObject(t,e,n,i).map((function(t){return et.HSL(t,o)}))},r.getBlendHSLAObject=function(t,e,n,r){return void 0===n&&(n=5),void 0===r&&(r={}),vt(t,e,n,r.decimals,pt.HSLA)},r.getBlendHSLA=function(t,e,n,i){void 0===n&&(n=5),void 0===i&&(i={});var o=w(i,t,e);return r.getBlendHSLAObject(t,e,n,i).map((function(t){return et.HSL(t,o)}))},r.getMixHEXObject=function(e,n){return void 0===n&&(n=t.Mix.ADDITIVE),bt.HEX(e,n,!1)},r.getMixHEX=function(e,n){return void 0===n&&(n=t.Mix.ADDITIVE),bt.HEX(e,n,!0)},r.getMixHEXAObject=function(e,n){return void 0===n&&(n=t.Mix.ADDITIVE),bt.HEXA(e,n,!1)},r.getMixHEXA=function(e,n){return void 0===n&&(n=t.Mix.ADDITIVE),bt.HEXA(e,n,!0)},r.getMixRGBObject=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.RGB(e,r,!1,w.apply(void 0,n([i],e,!1)))},r.getMixRGB=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.RGB(e,r,!0,w.apply(void 0,n([i],e,!1)))},r.getMixRGBAObject=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.RGBA(e,r,!1,w.apply(void 0,n([i],e,!1)))},r.getMixRGBA=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.RGBA(e,r,!0,w.apply(void 0,n([i],e,!1)))},r.getMixHSLObject=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.HSL(e,r,!1,w.apply(void 0,n([i],e,!1)))},r.getMixHSL=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.HSL(e,r,!0,w.apply(void 0,n([i],e,!1)))},r.getMixHSLAObject=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.HSLA(e,r,!1,w.apply(void 0,n([i],e,!1)))},r.getMixHSLA=function(e,r,i){return void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),bt.HSLA(e,r,!0,w.apply(void 0,n([i],e,!1)))},r.getShades=function(t,e,n){return void 0===n&&(n={}),gt(t,e,!0,w(n,t))},r.getTints=function(t,e,n){return void 0===n&&(n={}),gt(t,e,!1,w(n,t))},r.getHarmony=function(e,n,r,i){return void 0===n&&(n=t.Harmony.COMPLEMENTARY),void 0===r&&(r=t.Mix.ADDITIVE),void 0===i&&(i={}),function(e,n,r,i){var o;return(o={},o[t.Harmony.ANALOGOUS]=mt.buildHarmony(n,it,r,i),o[t.Harmony.COMPLEMENTARY]=mt.buildHarmony(n,ot,r,i),o[t.Harmony.SPLIT_COMPLEMENTARY]=mt.buildHarmony(n,at,r,i),o[t.Harmony.TRIADIC]=mt.buildHarmony(n,ct,r,i),o[t.Harmony.TETRADIC]=mt.buildHarmony(n,ut,r,i),o[t.Harmony.SQUARE]=mt.buildHarmony(n,st,r,i),o)[e]}(n,e,r,w(i,e))},r}();return t.ColorTranslator=Ht,t}({});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc