colortranslator
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -1,1 +0,1 @@ | ||
var t,e,r,n,o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},o.apply(this,arguments)};function a(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(t||(t={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(e||(e={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(r||(r={})),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"}(n||(n={}));var i,u,c,s,d,h,f,l=Object.keys(n),g=((i={})[t.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,i[t.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*\)$/,i[t.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*\)$/,i[t.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*\)$/,i),p=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,F=/^0x([a-f\d]{1,2})$/i,y="The provided string color doesn't have a correct format",A="The provided color object doesn't have the proper keys or format",m=function(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?Math.round(255*((e-t)*r+t)):r<3?Math.round(255*e):r<4?Math.round(255*((e-t)*(4-r)+t)):Math.round(255*t)},E=function(t,e,r){e/=100;var n=(r/=100)<=.5?r*(e+1):r+e-r*e,o=2*r-n;return{r:m(o,n,(t/=60)+2),g:m(o,n,t),b:m(o,n,t-2)}},H=function(t,e,r,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-e)*n),b:Math.round(255*(1-r)*n)}},v=function(t,e,r){t/=255,e/=255,r/=255;var n=1-Math.max(t,e,r),o=1-n,a=(o-t)/o,i=(o-e)/o,u=(o-r)/o;return{c:Math.round(100*a),m:Math.round(100*i),y:Math.round(100*u),k:Math.round(100*n)}},B=function(t,e,r,n){void 0===n&&(n=1),t/=255,e/=255,r/=255,n=Math.min(n,1);var o=Math.max(t,e,r),a=Math.min(t,e,r),i=o-a,u=0,c=0,s=(o+a)/2;if(0===i)u=0,c=0;else{switch(o){case t:u=(e-r)/i%6;break;case e:u=(r-t)/i+2;break;case r:u=(t-e)/i+4}(u=Math.round(60*u))<0&&(u+=360),c=i/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},M=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]],o=e?n:r,a=0,i=0,u=0,c=0;return(e?r:n).find((function(e,r){return t>=e[0]&&t<e[1]&&(a=e[0],i=e[1],u=o[r][0],c=o[r][1],!0)})),u+(c-u)/(i-a)*(t-a)},C=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},D=function(t){return b.test("".concat(t))?+"".concat(t).replace(b,"$1"):Math.min(+t,100)},R=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},S=function(t){var e=parseInt("".concat(t)).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},L=function(t){var e=parseInt("".concat(t)).toString(16).toUpperCase();return 1===e.length&&(e="0".concat(e)),e},G=function(t,e){return void 0===e&&(e=!1),!e&&b.test(t)?Math.min(255*+t.replace(b,"$1")/100,255):F.test(t)?3===t.length?e?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):e?parseInt(t)/255:parseInt(t):Math.min(+t,e?1:255)},k=function(t){return Math.min(b.test(t)?+t.replace(b,"$1")/100:+t,1)},O=function(t){return t.sort().join("").toUpperCase()},X=function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(+t*r)/r},j=function(t,e,r){return Math.max(e,Math.min(t,r))},I=((u={})[t.HEX]=function(t){return"#".concat(L(t.r)).concat(L(t.g)).concat(L(t.b)).concat(C(t,"a")&&L(t.a)||"")},u[t.RGB]=function(t){return"rgb".concat(C(t,"a")?"a":"","(").concat(X(t.r),",").concat(X(t.g),",").concat(X(t.b)).concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u[t.HSL]=function(t){return"hsl".concat(C(t,"a")?"a":"","(").concat(X(t.h),",").concat(X(t.s),"%,").concat(X(t.l),"%").concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u[t.CMYK]=function(t){return"cmyk(".concat(X(t.c),"%,").concat(X(t.m),"%,").concat(X(t.y),"%,").concat(X(t.k),"%").concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u),Y=function(t){if("string"==typeof t){var e=t.match(p),r=+e[1];switch(e[2]){case"rad":t=Math.round(180*r/Math.PI);break;case"turn":t=Math.round(360*r);break;default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},T=function(t){return"string"==typeof t&&(t=b.test(t)?+t.replace(b,"$1")/100:+t),isNaN(+t)||t>1?1:X(t,2)},K=function(t,e,n){return e.reduce((function(e,i){return a(a([],e,!0),[o(o({},t),{h:n===r.ADDITIVE?Y(t.h+i):Y(M(M(t.h,!1)+i,!0))})],!1)}),[o({},t)])},P=function(t,e){return K(t,[30,-30],e)},w=function(t,e){return K(t,[180],e)},x=function(t,e){return K(t,[150,-150],e)},N=function(t,e){return K(t,[120,-120],e)},V=function(t,e){return K(t,[60,-120,180],e)},U=function(t,e){return K(t,[90,-90,180],e)},$=Object.entries(t).reduce((function(e,r){var n=r[0],o=r[1];if(n!==t.HEX){var a=O(n.split(""));e[a]=o,e["A"+a]=o}return e}),{}),q=function(e){return"string"==typeof e?function(e){var r;if(Object.keys(t).some((function(t){if(g[t].test(e))return r=t,!0})),!r&&~l.indexOf(e)&&(r=t.HEX),!r)throw new Error(y);return r}(e):function(e){var r,n=!1,o=O(Object.keys(e));if($[o]&&(r=$[o]),r&&r===t.RGB){var a=Object.entries(e).some((function(t){return!F.test("".concat(t[1]))})),i=Object.entries(e).some((function(t){return!(b.test("".concat(t[1]))||!F.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));a&&i&&(n=!0),a||(r=t.HEX)}if(!r||n)throw new Error(A);return r}(e)},Q=((c={})[t.HEX]=function(t){var e=(~l.indexOf(t)?n[t]:t).match(g.HEX),r={r:R(e[1]||e[5]),g:R(e[2]||e[6]),b:R(e[3]||e[7])},o=e[4]||e[8];return void 0!==o&&(r.a=R(o)/255),r},c[t.RGB]=function(t){var e=t.match(g.RGB),r=G(e[1]||e[5]),n=G(e[2]||e[6]),o=G(e[3]||e[7]),a=e[4]||e[8],i={r:Math.min(r,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==a&&(i.a=T(a)),i},c[t.HSL]=function(t){var e=t.match(g.HSL),r=Y(e[1]||e[5]),n=D(e[2]||e[6]),o=D(e[3]||e[7]),a=e[4]||e[8],i=E(r,n,o);return void 0!==a&&(i.a=T(a)),i},c[t.CMYK]=function(t){var e=t.match(g.CMYK),r=k(e[1]||e[6]),n=k(e[2]||e[7]),o=k(e[3]||e[8]),a=k(e[4]||e[9]),i=e[5]||e[10],u=H(r,n,o,a);return void 0!==i&&(u.a=T(i)),u},c),_=((s={})[t.HEX]=function(t){var e={r:G("".concat(t.r)),g:G("".concat(t.g)),b:G("".concat(t.b))};return C(t,"a")&&(e.a=Math.min(G("".concat(t.a),!0),1)),e},s[t.RGB]=function(t){return this.HEX(t)},s[t.HSL]=function(t){var e=D("".concat(t.s)),r=D("".concat(t.l)),n=E(Y(t.h),e,r);return C(t,"a")&&(n.a=T(t.a)),n},s[t.CMYK]=function(t){var e=k("".concat(t.c)),r=k("".concat(t.m)),n=k("".concat(t.y)),o=k("".concat(t.k)),a=H(e,r,n,o);return C(t,"a")&&(a.a=T(t.a)),a},s),z=function(t,e){return void 0===e&&(e=q(t)),"string"==typeof t?Q[e](t):_[e](t)},J=((d={})[t.HEX]=function(t){return{r:S(t.r),g:S(t.g),b:S(t.b)}},d.HEXA=function(t){var e=J.HEX(t);return e.a=C(t,"a")?S(255*t.a):"0xFF",e},d[t.RGB]=function(t){return C(t,"a")&&delete t.a,t},d.RGBA=function(t){return t.a=C(t,"a")?X(t.a,2):1,t},d[t.HSL]=function(t){var e=B(t.r,t.g,t.b);return delete e.a,e},d.HSLA=function(t){var e=J.HSL(t);return e.a=C(t,"a")?X(t.a,2):1,e},d[t.CMYK]=function(t){return v(t.r,t.g,t.b)},d.CMYKA=function(t){var e=v(t.r,t.g,t.b);return e.a=C(t,"a")?X(t.a,2):1,e},d),W=function(e,r,n){var a=q(e),i="string"==typeof e,u=z(e,a),c="string"==typeof e&&C(u,"a")||"string"!=typeof e&&C(e,"a"),s=B(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(r+1):(100-s.l)/(r+1),h=Array(r).fill(null).map((function(t,e){return o(o({},s),{l:s.l+d*(e+1)*(1-2*+n)})}));switch(a){case t.HEX:default:return h.map((function(t){var e=E(t.h,t.s,t.l);return c&&(e.a=t.a),i?c?I.HEX(o(o({},e),{a:X(255*e.a,2)})):I.HEX(e):c?J.HEXA(e):J.HEX(e)}));case t.RGB:return h.map((function(t){var e=E(t.h,t.s,t.l);return c&&(e.a=t.a),i?I.RGB(e):c?J.RGBA(e):J.RGB(e)}));case t.HSL:return h.map((function(t){return i?I.HSL(t):c?J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:t.a})):J.HSL(E(t.h,t.s,t.l))}))}},Z=((h={buildHarmony:function(e,r,n){var o=q(e),a=z(e,o),i=B(a.r,a.g,a.b,a.a),u="string"==typeof e&&C(a,"a")||"string"!=typeof e&&C(e,"a"),c="string"==typeof e;switch(o){case t.HEX:default:return u?this.HEXA(i,r,n,c):this.HEX(i,r,n,c);case t.HSL:return u?this.HSLA(i,r,n,c):this.HSL(i,r,n,c);case t.RGB:return u?this.RGBA(i,r,n,c):this.RGB(i,r,n,c)}}})[t.HEX]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HEX(E(t.h,t.s,t.l)):J.HEX(E(t.h,t.s,t.l))}))},h.HEXA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HEX(o(o({},E(t.h,t.s,t.l)),{a:255*T(t.a)})):J.HEXA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[t.RGB]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.RGB(E(t.h,t.s,t.l)):J.RGB(E(t.h,t.s,t.l))}))},h.RGBA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.RGB(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)})):J.RGBA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[t.HSL]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HSL({h:t.h,s:t.s,l:t.l}):J.HSL(E(t.h,t.s,t.l))}))},h.HSLA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HSL(o(o({},t),{a:T(t.a)})):J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h),tt=((f={mix:function(t,e){var n,a,i,u,c,s,d,h,f,l,g,p,b,F,y,A=t.map((function(t){var e=q(t);return z(t,e)})),m=e===r.SUBTRACTIVE?A.map((function(t){var e,r,n,o,a,i,u,c,s,d,h,f,l,g,p=(e=t.r,r=t.g,n=t.b,o=Math.min(e,r,n),a=Math.min(255-e,255-r,255-n),i=e-o,u=r-o,c=n-o,s=Math.min(i,u),d=i-s,h=(u+s)/2,f=(c+u-s)/2,l=Math.max(d,h,f)/Math.max(i,u,c),g=isNaN(l)||l===1/0||l<=0?1:l,{r:d/g+a,y:h/g+a,b:f/g+a});return C(t,"a")&&(p.a=t.a),p})):null;function E(t){var n=e===r.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return t.reduce((function(t,n){var a=C(n,"a")?n.a:1,i={r:Math.min(t.r+n.r*a,255),b:Math.min(t.b+n.b*a,255),a:1-(1-a)*(1-t.a)},u="g"in t?t.g:t.y,c="g"in n?n.g:n.y;return o(o({},i),e===r.ADDITIVE?{g:Math.min(u+c*a,255)}:{y:Math.min(u+c*a,255)})}),n)}if(e===r.ADDITIVE)n=E(A);else{var H=E(m);a=H.r,i=H.y,u=H.b,c=Math.min(a,i,u),s=Math.min(255-a,255-i,255-u),d=a-c,h=i-c,f=u-c,l=Math.min(h,f),g=d+h-l,p=h+2*l,b=2*(f-l),F=Math.max(g,p,b)/Math.max(d,h,f),y=isNaN(F)||F===1/0||F<=0?1:F,(n={r:g/y+s,g:p/y+s,b:b/y+s}).a=H.a}return{r:X(n.r,2),g:X(n.g,2),b:X(n.b,2),a:j(n.a,0,1)}}})[t.HEX]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?I.HEX(n):J.HEX(n)},f.HEXA=function(t,e,r){var n=this.mix(t,e);return n.a=r?255*T(n.a):T(n.a),r?I.HEX(n):J.HEXA(n)},f[t.RGB]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?I.RGB(n):J.RGB(n)},f.RGBA=function(t,e,r){var n=this.mix(t,e);return r?I.RGB(n):J.RGBA(n)},f[t.HSL]=function(t,e,r){var n=this.mix(t,e),o=B(n.r,n.g,n.b);return delete n.a,delete o.a,r?I.HSL(o):J.HSL(n)},f.HSLA=function(t,e,r){var n=this.mix(t,e),o=B(n.r,n.g,n.b,n.a);return r?I.HSL(o):J.HSLA(n)},f),et=function(t,e,r,n,o){var a=n(z(t,e));return r?o(a):a},rt=function(t,e,r,n,o,a){r<1&&(r=5);var i=function(t,e,r){var n=r-1,o=(e.r-t.r)/n,a=(e.g-t.g)/n,i=(e.b-t.b)/n,u=T(t.a),c=(T(e.a)-u)/n;return Array(r).fill(null).map((function(r,s){return 0===s?t:s===n?e:{r:X(t.r+o*s),g:X(t.g+a*s),b:X(t.b+i*s),a:X(u+c*s,2)}}))}(z(t),z(e),r);return i.map((function(t){var e=o(t);return n?a(e):e}))},nt=function(){function t(t){this.rgb=z(t),this.updateHSL(),this.updateCMYK()}return t.prototype.updateRGB=function(){this.rgb=o(o({},E(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},t.prototype.updateRGBFromCMYK=function(){this.rgb=o(o({},H(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},t.prototype.updateHSL=function(){this.hsl=B(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},t.prototype.updateCMYK=function(){this.cmyk=v(this.rgb.r,this.rgb.g,this.rgb.b)},t.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},t.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},t.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},t.prototype.setH=function(t){return this.hsl.h=Y(t),this.updateRGBAndCMYK()},t.prototype.setS=function(t){return this.hsl.s=j(t,0,100),this.updateRGBAndCMYK()},t.prototype.setL=function(t){return this.hsl.l=j(t,0,100),this.updateRGBAndCMYK()},t.prototype.setR=function(t){return this.rgb.r=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setG=function(t){return this.rgb.g=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setB=function(t){return this.rgb.b=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setA=function(t){return this.hsl.a=this.rgb.a=j(t,0,1),this},t.prototype.setC=function(t){return this.cmyk.c=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setM=function(t){return this.cmyk.m=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setY=function(t){return this.cmyk.y=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setK=function(t){return this.cmyk.k=j(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(t.prototype,"H",{get:function(){return X(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"S",{get:function(){return X(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"L",{get:function(){return X(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R",{get:function(){return X(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"G",{get:function(){return X(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"B",{get:function(){return X(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"A",{get:function(){return X(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"C",{get:function(){return X(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"M",{get:function(){return X(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return X(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"K",{get:function(){return X(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXObject",{get:function(){return J.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXAObject",{get:function(){return J.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBAObject",{get:function(){return o(o({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLAObject",{get:function(){return o(o({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKAObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEX",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b};return I.HEX(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXA",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b,a:255*this.A};return I.HEX(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGB",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b};return I.RGB(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBA",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b,a:this.A};return I.RGB(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSL",{get:function(){var t=this.hsl,e={h:t.h,s:t.s,l:t.l};return I.HSL(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLA",{get:function(){return I.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYK",{get:function(){return I.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKA",{get:function(){return I.CMYK(o(o({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),t.toHEX=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HEX,I.HEX)},t.toHEXA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HEXA,I.HEX)},t.toRGB=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.RGB,I.RGB)},t.toRGBA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.RGBA,I.RGB)},t.toHSL=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HSL,I.HSL)},t.toHSLA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HSLA,I.HSL)},t.toCMYK=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.CMYK,I.CMYK)},t.toCMYKA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.CMYKA,I.CMYK)},t.getBlendHEX=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HEX,I.HEX)},t.getBlendHEXA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HEXA,I.HEX)},t.getBlendRGB=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.RGB,I.RGB)},t.getBlendRGBA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.RGBA,I.RGB)},t.getBlendHSL=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HSL,I.HSL)},t.getBlendHSLA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HSLA,I.HSL)},t.getMixHEX=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HEX(t,e,n)},t.getMixHEXA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HEXA(t,e,n)},t.getMixRGB=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.RGB(t,e,n)},t.getMixRGBA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.RGBA(t,e,n)},t.getMixHSL=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HSL(t,e,n)},t.getMixHSLA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HSLA(t,e,n)},t.getShades=function(t,e){return W(t,e,!0)},t.getTints=function(t,e){return W(t,e,!1)},t.getHarmony=function(t,n,o){switch(void 0===n&&(n=e.COMPLEMENTARY),void 0===o&&(o=r.ADDITIVE),n){case e.ANALOGOUS:return Z.buildHarmony(t,P,o);case e.SPLIT_COMPLEMENTARY:return Z.buildHarmony(t,x,o);case e.TRIADIC:return Z.buildHarmony(t,N,o);case e.TETRADIC:return Z.buildHarmony(t,V,o);case e.SQUARE:return Z.buildHarmony(t,U,o);default:return Z.buildHarmony(t,w,o)}},t}();export{nt as ColorTranslator,e as Harmony,r as Mix}; | ||
var t,e,r,n,o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},o.apply(this,arguments)};function a(t,e,r){if(r||2===arguments.length)for(var n,o=0,a=e.length;o<a;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(t||(t={})),function(t){t.ANALOGOUS="ANALOGOUS",t.COMPLEMENTARY="COMPLEMENTARY",t.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",t.TRIADIC="TRIADIC",t.TETRADIC="TETRADIC",t.SQUARE="SQUARE"}(e||(e={})),function(t){t.ADDITIVE="ADDITIVE",t.SUBTRACTIVE="SUBTRACTIVE"}(r||(r={})),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"}(n||(n={}));var i,u,c,s,d,h,f,l=Object.keys(n),g=((i={})[t.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,i[t.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*\)$/,i[t.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*\)$/,i[t.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*\)$/,i),p=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,F=/^0x([a-f\d]{1,2})$/i,y="The provided string color doesn't have a correct format",A="The provided color object doesn't have the proper keys or format",m=function(t,e,r){return r<0&&(r+=6),r>=6&&(r-=6),r<1?Math.round(255*((e-t)*r+t)):r<3?Math.round(255*e):r<4?Math.round(255*((e-t)*(4-r)+t)):Math.round(255*t)},E=function(t,e,r){e/=100;var n=(r/=100)<=.5?r*(e+1):r+e-r*e,o=2*r-n;return{r:m(o,n,(t/=60)+2),g:m(o,n,t),b:m(o,n,t-2)}},H=function(t,e,r,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-e)*n),b:Math.round(255*(1-r)*n)}},v=function(t,e,r){t/=255,e/=255,r/=255;var n=1-Math.max(t,e,r),o=1-n,a=(o-t)/o,i=(o-e)/o,u=(o-r)/o;return{c:Math.round(100*a),m:Math.round(100*i),y:Math.round(100*u),k:Math.round(100*n)}},B=function(t,e,r,n){void 0===n&&(n=1),t/=255,e/=255,r/=255,n=Math.min(n,1);var o=Math.max(t,e,r),a=Math.min(t,e,r),i=o-a,u=0,c=0,s=(o+a)/2;if(0===i)u=0,c=0;else{switch(o){case t:u=(e-r)/i%6;break;case e:u=(r-t)/i+2;break;case r:u=(t-e)/i+4}(u=Math.round(60*u))<0&&(u+=360),c=i/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},M=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]],o=e?n:r,a=0,i=0,u=0,c=0;return(e?r:n).find((function(e,r){return t>=e[0]&&t<e[1]&&(a=e[0],i=e[1],u=o[r][0],c=o[r][1],!0)})),u+(c-u)/(i-a)*(t-a)},C=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},D=function(t){return b.test("".concat(t))?+"".concat(t).replace(b,"$1"):Math.min(+t,100)},R=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},S=function(t){var e=parseInt("".concat(t)).toString(16).toUpperCase();return 1===e.length?"0x0".concat(e):"0x".concat(e)},L=function(t){var e=parseInt("".concat(t)).toString(16).toUpperCase();return 1===e.length&&(e="0".concat(e)),e},G=function(t,e){return void 0===e&&(e=!1),!e&&b.test(t)?Math.min(255*+t.replace(b,"$1")/100,255):F.test(t)?3===t.length?e?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):e?parseInt(t)/255:parseInt(t):Math.min(+t,e?1:255)},k=function(t){return Math.min(b.test(t)?+t.replace(b,"$1")/100:+t,1)},O=function(t){return t.sort().join("").toUpperCase()},X=function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(+t*r)/r},j=function(t,e,r){return Math.max(e,Math.min(t,r))},I=((u={})[t.HEX]=function(t){return"#".concat(L(t.r)).concat(L(t.g)).concat(L(t.b)).concat(C(t,"a")&&L(t.a)||"")},u[t.RGB]=function(t){return"rgb".concat(C(t,"a")?"a":"","(").concat(X(t.r),",").concat(X(t.g),",").concat(X(t.b)).concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u[t.HSL]=function(t){return"hsl".concat(C(t,"a")?"a":"","(").concat(X(t.h),",").concat(X(t.s),"%,").concat(X(t.l),"%").concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u[t.CMYK]=function(t){return"cmyk(".concat(X(t.c),"%,").concat(X(t.m),"%,").concat(X(t.y),"%,").concat(X(t.k),"%").concat(C(t,"a")&&",".concat(X(t.a,2))||"",")")},u),Y=function(t){if("string"==typeof t){var e=t.match(p),r=+e[1];switch(e[2]){case"rad":t=Math.round(180*r/Math.PI);break;case"turn":t=Math.round(360*r);break;default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},T=function(t){return"string"==typeof t&&(t=b.test(t)?+t.replace(b,"$1")/100:+t),isNaN(+t)||t>1?1:X(t,2)},K=function(t,e,n){return e.reduce((function(e,i){return a(a([],e,!0),[o(o({},t),{h:n===r.ADDITIVE?Y(t.h+i):Y(M(M(t.h,!1)+i,!0))})],!1)}),[o({},t)])},P=function(t,e){return K(t,[30,-30],e)},w=function(t,e){return K(t,[180],e)},x=function(t,e){return K(t,[150,-150],e)},N=function(t,e){return K(t,[120,-120],e)},V=function(t,e){return K(t,[60,-120,180],e)},U=function(t,e){return K(t,[90,-90,180],e)},$=Object.entries(t).reduce((function(e,r){var n=r[0],o=r[1];if(n!==t.HEX){var a=O(n.split(""));e[a]=o,e["A"+a]=o}return e}),{}),q=function(e){return"string"==typeof e?function(e){var r;if(Object.keys(t).some((function(t){if(g[t].test(e))return r=t,!0})),!r&&~l.indexOf(e)&&(r=t.HEX),!r)throw new Error(y);return r}(e):function(e){var r,n=!1,o=O(Object.keys(e));if($[o]&&(r=$[o]),r&&r===t.RGB){var a=Object.entries(e).some((function(t){return!F.test("".concat(t[1]))})),i=Object.entries(e).some((function(t){return!(b.test("".concat(t[1]))||!F.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));a&&i&&(n=!0),a||(r=t.HEX)}if(!r||n)throw new Error(A);return r}(e)},Q=((c={})[t.HEX]=function(t){var e=(~l.indexOf(t)?n[t]:t).match(g.HEX),r={r:R(e[1]||e[5]),g:R(e[2]||e[6]),b:R(e[3]||e[7])},o=e[4]||e[8];return void 0!==o&&(r.a=R(o)/255),r},c[t.RGB]=function(t){var e=t.match(g.RGB),r=G(e[1]||e[5]),n=G(e[2]||e[6]),o=G(e[3]||e[7]),a=e[4]||e[8],i={r:Math.min(r,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==a&&(i.a=T(a)),i},c[t.HSL]=function(t){var e=t.match(g.HSL),r=Y(e[1]||e[5]),n=D(e[2]||e[6]),o=D(e[3]||e[7]),a=e[4]||e[8],i=E(r,n,o);return void 0!==a&&(i.a=T(a)),i},c[t.CMYK]=function(t){var e=t.match(g.CMYK),r=k(e[1]||e[6]),n=k(e[2]||e[7]),o=k(e[3]||e[8]),a=k(e[4]||e[9]),i=e[5]||e[10],u=H(r,n,o,a);return void 0!==i&&(u.a=T(i)),u},c),_=((s={})[t.HEX]=function(t){var e={r:G("".concat(t.r)),g:G("".concat(t.g)),b:G("".concat(t.b))};return C(t,"a")&&(e.a=Math.min(G("".concat(t.a),!0),1)),e},s[t.RGB]=function(t){return this.HEX(t)},s[t.HSL]=function(t){var e=D("".concat(t.s)),r=D("".concat(t.l)),n=E(Y(t.h),e,r);return C(t,"a")&&(n.a=T(t.a)),n},s[t.CMYK]=function(t){var e=k("".concat(t.c)),r=k("".concat(t.m)),n=k("".concat(t.y)),o=k("".concat(t.k)),a=H(e,r,n,o);return C(t,"a")&&(a.a=T(t.a)),a},s),z=function(t,e){return void 0===e&&(e=q(t)),"string"==typeof t?Q[e](t):_[e](t)},J=((d={})[t.HEX]=function(t){return{r:S(t.r),g:S(t.g),b:S(t.b)}},d.HEXA=function(t){var e=J.HEX(t);return e.a=C(t,"a")?S(255*t.a):"0xFF",e},d[t.RGB]=function(t){return C(t,"a")&&delete t.a,t},d.RGBA=function(t){return t.a=C(t,"a")?X(t.a,2):1,t},d[t.HSL]=function(t){var e=B(t.r,t.g,t.b);return delete e.a,e},d.HSLA=function(t){var e=J.HSL(t);return e.a=C(t,"a")?X(t.a,2):1,e},d[t.CMYK]=function(t){return v(t.r,t.g,t.b)},d.CMYKA=function(t){var e=v(t.r,t.g,t.b);return e.a=C(t,"a")?X(t.a,2):1,e},d),W=function(e,r,n){var a=q(e),i="string"==typeof e,u=z(e,a),c="string"==typeof e&&C(u,"a")||"string"!=typeof e&&C(e,"a"),s=B(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(r+1):(100-s.l)/(r+1),h=Array(r).fill(null).map((function(t,e){return o(o({},s),{l:s.l+d*(e+1)*(1-2*+n)})}));switch(a){case t.HEX:default:return h.map((function(t){var e=E(t.h,t.s,t.l);return c&&(e.a=t.a),i?c?I.HEX(o(o({},e),{a:X(255*e.a,2)})):I.HEX(e):c?J.HEXA(e):J.HEX(e)}));case t.RGB:return h.map((function(t){var e=E(t.h,t.s,t.l);return c&&(e.a=t.a),i?I.RGB(e):c?J.RGBA(e):J.RGB(e)}));case t.HSL:return h.map((function(t){return i?I.HSL(t):c?J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:t.a})):J.HSL(E(t.h,t.s,t.l))}))}},Z=((h={buildHarmony:function(e,r,n){var o=q(e),a=z(e,o),i=B(a.r,a.g,a.b,a.a),u="string"==typeof e&&C(a,"a")||"string"!=typeof e&&C(e,"a"),c="string"==typeof e;switch(o){case t.HEX:default:return u?this.HEXA(i,r,n,c):this.HEX(i,r,n,c);case t.HSL:return u?this.HSLA(i,r,n,c):this.HSL(i,r,n,c);case t.RGB:return u?this.RGBA(i,r,n,c):this.RGB(i,r,n,c)}}})[t.HEX]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HEX(E(t.h,t.s,t.l)):J.HEX(E(t.h,t.s,t.l))}))},h.HEXA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HEX(o(o({},E(t.h,t.s,t.l)),{a:255*T(t.a)})):J.HEXA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[t.RGB]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.RGB(E(t.h,t.s,t.l)):J.RGB(E(t.h,t.s,t.l))}))},h.RGBA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.RGB(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)})):J.RGBA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[t.HSL]=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HSL({h:t.h,s:t.s,l:t.l}):J.HSL(E(t.h,t.s,t.l))}))},h.HSLA=function(t,e,r,n){return e(t,r).map((function(t){return n?I.HSL(o(o({},t),{a:T(t.a)})):J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:T(t.a)}))}))},h),tt=((f={mix:function(t,e){var n,a,i,u,c,s,d,h,f,l,g,p,b,F,y,A=t.map((function(t){var e=q(t);return z(t,e)})),m=e===r.SUBTRACTIVE?A.map((function(t){var e,r,n,o,a,i,u,c,s,d,h,f,l,g,p=(e=t.r,r=t.g,n=t.b,o=Math.min(e,r,n),a=Math.min(255-e,255-r,255-n),i=e-o,u=r-o,c=n-o,s=Math.min(i,u),d=i-s,h=(u+s)/2,f=(c+u-s)/2,l=Math.max(d,h,f)/Math.max(i,u,c),g=isNaN(l)||l===1/0||l<=0?1:l,{r:d/g+a,y:h/g+a,b:f/g+a});return C(t,"a")&&(p.a=t.a),p})):null;function E(t){var n=e===r.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return t.reduce((function(t,n){var a=C(n,"a")?n.a:1,i={r:Math.min(t.r+n.r*a,255),b:Math.min(t.b+n.b*a,255),a:1-(1-a)*(1-t.a)},u="g"in t?t.g:t.y,c="g"in n?n.g:n.y;return o(o({},i),e===r.ADDITIVE?{g:Math.min(u+c*a,255)}:{y:Math.min(u+c*a,255)})}),n)}if(e===r.ADDITIVE)n=E(A);else{var H=E(m);a=H.r,i=H.y,u=H.b,c=Math.min(a,i,u),s=Math.min(255-a,255-i,255-u),d=a-c,h=i-c,f=u-c,l=Math.min(h,f),g=d+h-l,p=h+l,b=2*(f-l),F=Math.max(g,p,b)/Math.max(d,h,f),y=isNaN(F)||F===1/0||F<=0?1:F,(n={r:g/y+s,g:p/y+s,b:b/y+s}).a=H.a}return{r:X(n.r,2),g:X(n.g,2),b:X(n.b,2),a:j(n.a,0,1)}}})[t.HEX]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?I.HEX(n):J.HEX(n)},f.HEXA=function(t,e,r){var n=this.mix(t,e);return n.a=r?255*T(n.a):T(n.a),r?I.HEX(n):J.HEXA(n)},f[t.RGB]=function(t,e,r){var n=this.mix(t,e);return delete n.a,r?I.RGB(n):J.RGB(n)},f.RGBA=function(t,e,r){var n=this.mix(t,e);return r?I.RGB(n):J.RGBA(n)},f[t.HSL]=function(t,e,r){var n=this.mix(t,e),o=B(n.r,n.g,n.b);return delete n.a,delete o.a,r?I.HSL(o):J.HSL(n)},f.HSLA=function(t,e,r){var n=this.mix(t,e),o=B(n.r,n.g,n.b,n.a);return r?I.HSL(o):J.HSLA(n)},f),et=function(t,e,r,n,o){var a=n(z(t,e));return r?o(a):a},rt=function(t,e,r,n,o,a){r<1&&(r=5);var i=function(t,e,r){var n=r-1,o=(e.r-t.r)/n,a=(e.g-t.g)/n,i=(e.b-t.b)/n,u=T(t.a),c=(T(e.a)-u)/n;return Array(r).fill(null).map((function(r,s){return 0===s?t:s===n?e:{r:X(t.r+o*s),g:X(t.g+a*s),b:X(t.b+i*s),a:X(u+c*s,2)}}))}(z(t),z(e),r);return i.map((function(t){var e=o(t);return n?a(e):e}))},nt=function(){function t(t){this.rgb=z(t),this.updateHSL(),this.updateCMYK()}return t.prototype.updateRGB=function(){this.rgb=o(o({},E(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},t.prototype.updateRGBFromCMYK=function(){this.rgb=o(o({},H(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},t.prototype.updateHSL=function(){this.hsl=B(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},t.prototype.updateCMYK=function(){this.cmyk=v(this.rgb.r,this.rgb.g,this.rgb.b)},t.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},t.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},t.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},t.prototype.setH=function(t){return this.hsl.h=Y(t),this.updateRGBAndCMYK()},t.prototype.setS=function(t){return this.hsl.s=j(t,0,100),this.updateRGBAndCMYK()},t.prototype.setL=function(t){return this.hsl.l=j(t,0,100),this.updateRGBAndCMYK()},t.prototype.setR=function(t){return this.rgb.r=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setG=function(t){return this.rgb.g=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setB=function(t){return this.rgb.b=j(t,0,255),this.updateHSLAndCMYK()},t.prototype.setA=function(t){return this.hsl.a=this.rgb.a=j(t,0,1),this},t.prototype.setC=function(t){return this.cmyk.c=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setM=function(t){return this.cmyk.m=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setY=function(t){return this.cmyk.y=j(t,0,100),this.updateRGBAndHSL()},t.prototype.setK=function(t){return this.cmyk.k=j(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(t.prototype,"H",{get:function(){return X(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"S",{get:function(){return X(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"L",{get:function(){return X(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R",{get:function(){return X(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"G",{get:function(){return X(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"B",{get:function(){return X(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"A",{get:function(){return X(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"C",{get:function(){return X(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"M",{get:function(){return X(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return X(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"K",{get:function(){return X(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXObject",{get:function(){return J.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXAObject",{get:function(){return J.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBAObject",{get:function(){return o(o({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLAObject",{get:function(){return o(o({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKAObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEX",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b};return I.HEX(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXA",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b,a:255*this.A};return I.HEX(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGB",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b};return I.RGB(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBA",{get:function(){var t=this.rgb,e={r:t.r,g:t.g,b:t.b,a:this.A};return I.RGB(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSL",{get:function(){var t=this.hsl,e={h:t.h,s:t.s,l:t.l};return I.HSL(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLA",{get:function(){return I.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYK",{get:function(){return I.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKA",{get:function(){return I.CMYK(o(o({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),t.toHEX=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HEX,I.HEX)},t.toHEXA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HEXA,I.HEX)},t.toRGB=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.RGB,I.RGB)},t.toRGBA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.RGBA,I.RGB)},t.toHSL=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HSL,I.HSL)},t.toHSLA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.HSLA,I.HSL)},t.toCMYK=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.CMYK,I.CMYK)},t.toCMYKA=function(t,e){void 0===e&&(e=!0);var r=q(t);return et(t,r,e,J.CMYKA,I.CMYK)},t.getBlendHEX=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HEX,I.HEX)},t.getBlendHEXA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HEXA,I.HEX)},t.getBlendRGB=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.RGB,I.RGB)},t.getBlendRGBA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.RGBA,I.RGB)},t.getBlendHSL=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HSL,I.HSL)},t.getBlendHSLA=function(t,e,r,n){return void 0===r&&(r=5),void 0===n&&(n=!0),rt(t,e,r,n,J.HSLA,I.HSL)},t.getMixHEX=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HEX(t,e,n)},t.getMixHEXA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HEXA(t,e,n)},t.getMixRGB=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.RGB(t,e,n)},t.getMixRGBA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.RGBA(t,e,n)},t.getMixHSL=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HSL(t,e,n)},t.getMixHSLA=function(t,e,n){return void 0===e&&(e=r.ADDITIVE),void 0===n&&(n=!0),tt.HSLA(t,e,n)},t.getShades=function(t,e){return W(t,e,!0)},t.getTints=function(t,e){return W(t,e,!1)},t.getHarmony=function(t,n,o){switch(void 0===n&&(n=e.COMPLEMENTARY),void 0===o&&(o=r.ADDITIVE),n){case e.ANALOGOUS:return Z.buildHarmony(t,P,o);case e.SPLIT_COMPLEMENTARY:return Z.buildHarmony(t,x,o);case e.TRIADIC:return Z.buildHarmony(t,N,o);case e.TETRADIC:return Z.buildHarmony(t,V,o);case e.SQUARE:return Z.buildHarmony(t,U,o);default:return Z.buildHarmony(t,w,o)}},t}();export{nt as ColorTranslator,e as Harmony,r as Mix}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var t,r,e,n,o=function(){return o=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function i(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(t||(t={})),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,(e=exports.Mix||(exports.Mix={})).ADDITIVE="ADDITIVE",e.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"}(n||(n={}));var a,u,c,s,d,l,h,f=Object.keys(n),p=((a={})[t.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[t.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[t.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[t.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),g=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,F=/^0x([a-f\d]{1,2})$/i,y="The provided string color doesn't have a correct format",m="The provided color object doesn't have the proper keys or format",A=function(t,r,e){return e<0&&(e+=6),e>=6&&(e-=6),e<1?Math.round(255*((r-t)*e+t)):e<3?Math.round(255*r):e<4?Math.round(255*((r-t)*(4-e)+t)):Math.round(255*t)},E=function(t,r,e){r/=100;var n=(e/=100)<=.5?e*(r+1):e+r-e*r,o=2*e-n;return{r:A(o,n,(t/=60)+2),g:A(o,n,t),b:A(o,n,t-2)}},H=function(t,r,e,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-r)*n),b:Math.round(255*(1-e)*n)}},v=function(t,r,e){t/=255,r/=255,e/=255;var n=1-Math.max(t,r,e),o=1-n,i=(o-t)/o,a=(o-r)/o,u=(o-e)/o;return{c:Math.round(100*i),m:Math.round(100*a),y:Math.round(100*u),k:Math.round(100*n)}},B=function(t,r,e,n){void 0===n&&(n=1),t/=255,r/=255,e/=255,n=Math.min(n,1);var o=Math.max(t,r,e),i=Math.min(t,r,e),a=o-i,u=0,c=0,s=(o+i)/2;if(0===a)u=0,c=0;else{switch(o){case t:u=(r-e)/a%6;break;case r:u=(e-t)/a+2;break;case e:u=(t-r)/a+4}(u=Math.round(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},M=function(t,r){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var e=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],o=r?n:e,i=0,a=0,u=0,c=0;return(r?e:n).find((function(r,e){return t>=r[0]&&t<r[1]&&(i=r[0],a=r[1],u=o[e][0],c=o[e][1],!0)})),u+(c-u)/(a-i)*(t-i)},C=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},D=function(t){return b.test("".concat(t))?+"".concat(t).replace(b,"$1"):Math.min(+t,100)},R=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},S=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length?"0x0".concat(r):"0x".concat(r)},L=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length&&(r="0".concat(r)),r},G=function(t,r){return void 0===r&&(r=!1),!r&&b.test(t)?Math.min(255*+t.replace(b,"$1")/100,255):F.test(t)?3===t.length?r?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):r?parseInt(t)/255:parseInt(t):Math.min(+t,r?1:255)},k=function(t){return Math.min(b.test(t)?+t.replace(b,"$1")/100:+t,1)},x=function(t){return t.sort().join("").toUpperCase()},O=function(t,r){void 0===r&&(r=0);var e=Math.pow(10,r);return Math.round(+t*e)/e},X=function(t,r,e){return Math.max(r,Math.min(t,e))},j=((u={})[t.HEX]=function(t){return"#".concat(L(t.r)).concat(L(t.g)).concat(L(t.b)).concat(C(t,"a")&&L(t.a)||"")},u[t.RGB]=function(t){return"rgb".concat(C(t,"a")?"a":"","(").concat(O(t.r),",").concat(O(t.g),",").concat(O(t.b)).concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u[t.HSL]=function(t){return"hsl".concat(C(t,"a")?"a":"","(").concat(O(t.h),",").concat(O(t.s),"%,").concat(O(t.l),"%").concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u[t.CMYK]=function(t){return"cmyk(".concat(O(t.c),"%,").concat(O(t.m),"%,").concat(O(t.y),"%,").concat(O(t.k),"%").concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u),I=function(t){if("string"==typeof t){var r=t.match(g),e=+r[1];switch(r[2]){case"rad":t=Math.round(180*e/Math.PI);break;case"turn":t=Math.round(360*e);break;default:t=e}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},Y=function(t){return"string"==typeof t&&(t=b.test(t)?+t.replace(b,"$1")/100:+t),isNaN(+t)||t>1?1:O(t,2)},T=function(t,r,e){return r.reduce((function(r,n){return i(i([],r,!0),[o(o({},t),{h:e===exports.Mix.ADDITIVE?I(t.h+n):I(M(M(t.h,!1)+n,!0))})],!1)}),[o({},t)])},K=function(t,r){return T(t,[30,-30],r)},P=function(t,r){return T(t,[180],r)},w=function(t,r){return T(t,[150,-150],r)},N=function(t,r){return T(t,[120,-120],r)},V=function(t,r){return T(t,[60,-120,180],r)},U=function(t,r){return T(t,[90,-90,180],r)},$=Object.entries(t).reduce((function(r,e){var n=e[0],o=e[1];if(n!==t.HEX){var i=x(n.split(""));r[i]=o,r["A"+i]=o}return r}),{}),q=function(r){return"string"==typeof r?function(r){var e;if(Object.keys(t).some((function(t){if(p[t].test(r))return e=t,!0})),!e&&~f.indexOf(r)&&(e=t.HEX),!e)throw new Error(y);return e}(r):function(r){var e,n=!1,o=x(Object.keys(r));if($[o]&&(e=$[o]),e&&e===t.RGB){var i=Object.entries(r).some((function(t){return!F.test("".concat(t[1]))})),a=Object.entries(r).some((function(t){return!(b.test("".concat(t[1]))||!F.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));i&&a&&(n=!0),i||(e=t.HEX)}if(!e||n)throw new Error(m);return e}(r)},Q=((c={})[t.HEX]=function(t){var r=(~f.indexOf(t)?n[t]:t).match(p.HEX),e={r:R(r[1]||r[5]),g:R(r[2]||r[6]),b:R(r[3]||r[7])},o=r[4]||r[8];return void 0!==o&&(e.a=R(o)/255),e},c[t.RGB]=function(t){var r=t.match(p.RGB),e=G(r[1]||r[5]),n=G(r[2]||r[6]),o=G(r[3]||r[7]),i=r[4]||r[8],a={r:Math.min(e,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==i&&(a.a=Y(i)),a},c[t.HSL]=function(t){var r=t.match(p.HSL),e=I(r[1]||r[5]),n=D(r[2]||r[6]),o=D(r[3]||r[7]),i=r[4]||r[8],a=E(e,n,o);return void 0!==i&&(a.a=Y(i)),a},c[t.CMYK]=function(t){var r=t.match(p.CMYK),e=k(r[1]||r[6]),n=k(r[2]||r[7]),o=k(r[3]||r[8]),i=k(r[4]||r[9]),a=r[5]||r[10],u=H(e,n,o,i);return void 0!==a&&(u.a=Y(a)),u},c),_=((s={})[t.HEX]=function(t){var r={r:G("".concat(t.r)),g:G("".concat(t.g)),b:G("".concat(t.b))};return C(t,"a")&&(r.a=Math.min(G("".concat(t.a),!0),1)),r},s[t.RGB]=function(t){return this.HEX(t)},s[t.HSL]=function(t){var r=D("".concat(t.s)),e=D("".concat(t.l)),n=E(I(t.h),r,e);return C(t,"a")&&(n.a=Y(t.a)),n},s[t.CMYK]=function(t){var r=k("".concat(t.c)),e=k("".concat(t.m)),n=k("".concat(t.y)),o=k("".concat(t.k)),i=H(r,e,n,o);return C(t,"a")&&(i.a=Y(t.a)),i},s),z=function(t,r){return void 0===r&&(r=q(t)),"string"==typeof t?Q[r](t):_[r](t)},J=((d={})[t.HEX]=function(t){return{r:S(t.r),g:S(t.g),b:S(t.b)}},d.HEXA=function(t){var r=J.HEX(t);return r.a=C(t,"a")?S(255*t.a):"0xFF",r},d[t.RGB]=function(t){return C(t,"a")&&delete t.a,t},d.RGBA=function(t){return t.a=C(t,"a")?O(t.a,2):1,t},d[t.HSL]=function(t){var r=B(t.r,t.g,t.b);return delete r.a,r},d.HSLA=function(t){var r=J.HSL(t);return r.a=C(t,"a")?O(t.a,2):1,r},d[t.CMYK]=function(t){return v(t.r,t.g,t.b)},d.CMYKA=function(t){var r=v(t.r,t.g,t.b);return r.a=C(t,"a")?O(t.a,2):1,r},d),W=function(r,e,n){var i=q(r),a="string"==typeof r,u=z(r,i),c="string"==typeof r&&C(u,"a")||"string"!=typeof r&&C(r,"a"),s=B(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(e+1):(100-s.l)/(e+1),l=Array(e).fill(null).map((function(t,r){return o(o({},s),{l:s.l+d*(r+1)*(1-2*+n)})}));switch(i){case t.HEX:default:return l.map((function(t){var r=E(t.h,t.s,t.l);return c&&(r.a=t.a),a?c?j.HEX(o(o({},r),{a:O(255*r.a,2)})):j.HEX(r):c?J.HEXA(r):J.HEX(r)}));case t.RGB:return l.map((function(t){var r=E(t.h,t.s,t.l);return c&&(r.a=t.a),a?j.RGB(r):c?J.RGBA(r):J.RGB(r)}));case t.HSL:return l.map((function(t){return a?j.HSL(t):c?J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:t.a})):J.HSL(E(t.h,t.s,t.l))}))}},Z=((l={buildHarmony:function(r,e,n){var o=q(r),i=z(r,o),a=B(i.r,i.g,i.b,i.a),u="string"==typeof r&&C(i,"a")||"string"!=typeof r&&C(r,"a"),c="string"==typeof r;switch(o){case t.HEX:default:return u?this.HEXA(a,e,n,c):this.HEX(a,e,n,c);case t.HSL:return u?this.HSLA(a,e,n,c):this.HSL(a,e,n,c);case t.RGB:return u?this.RGBA(a,e,n,c):this.RGB(a,e,n,c)}}})[t.HEX]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HEX(E(t.h,t.s,t.l)):J.HEX(E(t.h,t.s,t.l))}))},l.HEXA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HEX(o(o({},E(t.h,t.s,t.l)),{a:255*Y(t.a)})):J.HEXA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l[t.RGB]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.RGB(E(t.h,t.s,t.l)):J.RGB(E(t.h,t.s,t.l))}))},l.RGBA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.RGB(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)})):J.RGBA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l[t.HSL]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HSL({h:t.h,s:t.s,l:t.l}):J.HSL(E(t.h,t.s,t.l))}))},l.HSLA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HSL(o(o({},t),{a:Y(t.a)})):J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l),tt=((h={mix:function(t,r){var e,n,i,a,u,c,s,d,l,h,f,p,g,b,F,y=t.map((function(t){var r=q(t);return z(t,r)})),m=r===exports.Mix.SUBTRACTIVE?y.map((function(t){var r,e,n,o,i,a,u,c,s,d,l,h,f,p,g=(r=t.r,e=t.g,n=t.b,o=Math.min(r,e,n),i=Math.min(255-r,255-e,255-n),a=r-o,u=e-o,c=n-o,s=Math.min(a,u),d=a-s,l=(u+s)/2,h=(c+u-s)/2,f=Math.max(d,l,h)/Math.max(a,u,c),p=isNaN(f)||f===1/0||f<=0?1:f,{r:d/p+i,y:l/p+i,b:h/p+i});return C(t,"a")&&(g.a=t.a),g})):null;function A(t){var e=r===exports.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return t.reduce((function(t,e){var n=C(e,"a")?e.a:1,i={r:Math.min(t.r+e.r*n,255),b:Math.min(t.b+e.b*n,255),a:1-(1-n)*(1-t.a)},a="g"in t?t.g:t.y,u="g"in e?e.g:e.y;return o(o({},i),r===exports.Mix.ADDITIVE?{g:Math.min(a+u*n,255)}:{y:Math.min(a+u*n,255)})}),e)}if(r===exports.Mix.ADDITIVE)e=A(y);else{var E=A(m);n=E.r,i=E.y,a=E.b,u=Math.min(n,i,a),c=Math.min(255-n,255-i,255-a),s=n-u,d=i-u,l=a-u,h=Math.min(d,l),f=s+d-h,p=d+2*h,g=2*(l-h),b=Math.max(f,p,g)/Math.max(s,d,l),F=isNaN(b)||b===1/0||b<=0?1:b,(e={r:f/F+c,g:p/F+c,b:g/F+c}).a=E.a}return{r:O(e.r,2),g:O(e.g,2),b:O(e.b,2),a:X(e.a,0,1)}}})[t.HEX]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?j.HEX(n):J.HEX(n)},h.HEXA=function(t,r,e){var n=this.mix(t,r);return n.a=e?255*Y(n.a):Y(n.a),e?j.HEX(n):J.HEXA(n)},h[t.RGB]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?j.RGB(n):J.RGB(n)},h.RGBA=function(t,r,e){var n=this.mix(t,r);return e?j.RGB(n):J.RGBA(n)},h[t.HSL]=function(t,r,e){var n=this.mix(t,r),o=B(n.r,n.g,n.b);return delete n.a,delete o.a,e?j.HSL(o):J.HSL(n)},h.HSLA=function(t,r,e){var n=this.mix(t,r),o=B(n.r,n.g,n.b,n.a);return e?j.HSL(o):J.HSLA(n)},h),rt=function(t,r,e,n,o){var i=n(z(t,r));return e?o(i):i},et=function(t,r,e,n,o,i){e<1&&(e=5);var a=function(t,r,e){var n=e-1,o=(r.r-t.r)/n,i=(r.g-t.g)/n,a=(r.b-t.b)/n,u=Y(t.a),c=(Y(r.a)-u)/n;return Array(e).fill(null).map((function(e,s){return 0===s?t:s===n?r:{r:O(t.r+o*s),g:O(t.g+i*s),b:O(t.b+a*s),a:O(u+c*s,2)}}))}(z(t),z(r),e);return a.map((function(t){var r=o(t);return n?i(r):r}))},nt=function(){function t(t){this.rgb=z(t),this.updateHSL(),this.updateCMYK()}return t.prototype.updateRGB=function(){this.rgb=o(o({},E(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},t.prototype.updateRGBFromCMYK=function(){this.rgb=o(o({},H(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},t.prototype.updateHSL=function(){this.hsl=B(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},t.prototype.updateCMYK=function(){this.cmyk=v(this.rgb.r,this.rgb.g,this.rgb.b)},t.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},t.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},t.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},t.prototype.setH=function(t){return this.hsl.h=I(t),this.updateRGBAndCMYK()},t.prototype.setS=function(t){return this.hsl.s=X(t,0,100),this.updateRGBAndCMYK()},t.prototype.setL=function(t){return this.hsl.l=X(t,0,100),this.updateRGBAndCMYK()},t.prototype.setR=function(t){return this.rgb.r=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setG=function(t){return this.rgb.g=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setB=function(t){return this.rgb.b=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setA=function(t){return this.hsl.a=this.rgb.a=X(t,0,1),this},t.prototype.setC=function(t){return this.cmyk.c=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setM=function(t){return this.cmyk.m=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setY=function(t){return this.cmyk.y=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setK=function(t){return this.cmyk.k=X(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(t.prototype,"H",{get:function(){return O(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"S",{get:function(){return O(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"L",{get:function(){return O(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R",{get:function(){return O(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"G",{get:function(){return O(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"B",{get:function(){return O(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"A",{get:function(){return O(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"C",{get:function(){return O(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"M",{get:function(){return O(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return O(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"K",{get:function(){return O(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXObject",{get:function(){return J.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXAObject",{get:function(){return J.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBAObject",{get:function(){return o(o({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLAObject",{get:function(){return o(o({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKAObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEX",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return j.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:255*this.A};return j.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGB",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return j.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:this.A};return j.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSL",{get:function(){var t=this.hsl,r={h:t.h,s:t.s,l:t.l};return j.HSL(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLA",{get:function(){return j.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYK",{get:function(){return j.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKA",{get:function(){return j.CMYK(o(o({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),t.toHEX=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HEX,j.HEX)},t.toHEXA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HEXA,j.HEX)},t.toRGB=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.RGB,j.RGB)},t.toRGBA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.RGBA,j.RGB)},t.toHSL=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HSL,j.HSL)},t.toHSLA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HSLA,j.HSL)},t.toCMYK=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.CMYK,j.CMYK)},t.toCMYKA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.CMYKA,j.CMYK)},t.getBlendHEX=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HEX,j.HEX)},t.getBlendHEXA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HEXA,j.HEX)},t.getBlendRGB=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.RGB,j.RGB)},t.getBlendRGBA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.RGBA,j.RGB)},t.getBlendHSL=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HSL,j.HSL)},t.getBlendHSLA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HSLA,j.HSL)},t.getMixHEX=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HEX(t,r,e)},t.getMixHEXA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HEXA(t,r,e)},t.getMixRGB=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.RGB(t,r,e)},t.getMixRGBA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.RGBA(t,r,e)},t.getMixHSL=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HSL(t,r,e)},t.getMixHSLA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HSLA(t,r,e)},t.getShades=function(t,r){return W(t,r,!0)},t.getTints=function(t,r){return W(t,r,!1)},t.getHarmony=function(t,r,e){switch(void 0===r&&(r=exports.Harmony.COMPLEMENTARY),void 0===e&&(e=exports.Mix.ADDITIVE),r){case exports.Harmony.ANALOGOUS:return Z.buildHarmony(t,K,e);case exports.Harmony.SPLIT_COMPLEMENTARY:return Z.buildHarmony(t,w,e);case exports.Harmony.TRIADIC:return Z.buildHarmony(t,N,e);case exports.Harmony.TETRADIC:return Z.buildHarmony(t,V,e);case exports.Harmony.SQUARE:return Z.buildHarmony(t,U,e);default:return Z.buildHarmony(t,P,e)}},t}();exports.ColorTranslator=nt; | ||
"use strict";var t,r,e,n,o=function(){return o=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},o.apply(this,arguments)};function i(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(t||(t={})),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,(e=exports.Mix||(exports.Mix={})).ADDITIVE="ADDITIVE",e.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"}(n||(n={}));var a,u,c,s,d,l,h,f=Object.keys(n),p=((a={})[t.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[t.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[t.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[t.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),g=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,b=/^(\d+(?:\.\d+)?|\.\d+)%$/,F=/^0x([a-f\d]{1,2})$/i,y="The provided string color doesn't have a correct format",m="The provided color object doesn't have the proper keys or format",A=function(t,r,e){return e<0&&(e+=6),e>=6&&(e-=6),e<1?Math.round(255*((r-t)*e+t)):e<3?Math.round(255*r):e<4?Math.round(255*((r-t)*(4-e)+t)):Math.round(255*t)},E=function(t,r,e){r/=100;var n=(e/=100)<=.5?e*(r+1):e+r-e*r,o=2*e-n;return{r:A(o,n,(t/=60)+2),g:A(o,n,t),b:A(o,n,t-2)}},H=function(t,r,e,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-r)*n),b:Math.round(255*(1-e)*n)}},v=function(t,r,e){t/=255,r/=255,e/=255;var n=1-Math.max(t,r,e),o=1-n,i=(o-t)/o,a=(o-r)/o,u=(o-e)/o;return{c:Math.round(100*i),m:Math.round(100*a),y:Math.round(100*u),k:Math.round(100*n)}},B=function(t,r,e,n){void 0===n&&(n=1),t/=255,r/=255,e/=255,n=Math.min(n,1);var o=Math.max(t,r,e),i=Math.min(t,r,e),a=o-i,u=0,c=0,s=(o+i)/2;if(0===a)u=0,c=0;else{switch(o){case t:u=(r-e)/a%6;break;case r:u=(e-t)/a+2;break;case e:u=(t-r)/a+4}(u=Math.round(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},M=function(t,r){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var e=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],o=r?n:e,i=0,a=0,u=0,c=0;return(r?e:n).find((function(r,e){return t>=r[0]&&t<r[1]&&(i=r[0],a=r[1],u=o[e][0],c=o[e][1],!0)})),u+(c-u)/(a-i)*(t-i)},C=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},D=function(t){return b.test("".concat(t))?+"".concat(t).replace(b,"$1"):Math.min(+t,100)},R=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},S=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length?"0x0".concat(r):"0x".concat(r)},L=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length&&(r="0".concat(r)),r},G=function(t,r){return void 0===r&&(r=!1),!r&&b.test(t)?Math.min(255*+t.replace(b,"$1")/100,255):F.test(t)?3===t.length?r?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):r?parseInt(t)/255:parseInt(t):Math.min(+t,r?1:255)},k=function(t){return Math.min(b.test(t)?+t.replace(b,"$1")/100:+t,1)},x=function(t){return t.sort().join("").toUpperCase()},O=function(t,r){void 0===r&&(r=0);var e=Math.pow(10,r);return Math.round(+t*e)/e},X=function(t,r,e){return Math.max(r,Math.min(t,e))},j=((u={})[t.HEX]=function(t){return"#".concat(L(t.r)).concat(L(t.g)).concat(L(t.b)).concat(C(t,"a")&&L(t.a)||"")},u[t.RGB]=function(t){return"rgb".concat(C(t,"a")?"a":"","(").concat(O(t.r),",").concat(O(t.g),",").concat(O(t.b)).concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u[t.HSL]=function(t){return"hsl".concat(C(t,"a")?"a":"","(").concat(O(t.h),",").concat(O(t.s),"%,").concat(O(t.l),"%").concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u[t.CMYK]=function(t){return"cmyk(".concat(O(t.c),"%,").concat(O(t.m),"%,").concat(O(t.y),"%,").concat(O(t.k),"%").concat(C(t,"a")&&",".concat(O(t.a,2))||"",")")},u),I=function(t){if("string"==typeof t){var r=t.match(g),e=+r[1];switch(r[2]){case"rad":t=Math.round(180*e/Math.PI);break;case"turn":t=Math.round(360*e);break;default:t=e}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},Y=function(t){return"string"==typeof t&&(t=b.test(t)?+t.replace(b,"$1")/100:+t),isNaN(+t)||t>1?1:O(t,2)},T=function(t,r,e){return r.reduce((function(r,n){return i(i([],r,!0),[o(o({},t),{h:e===exports.Mix.ADDITIVE?I(t.h+n):I(M(M(t.h,!1)+n,!0))})],!1)}),[o({},t)])},K=function(t,r){return T(t,[30,-30],r)},P=function(t,r){return T(t,[180],r)},w=function(t,r){return T(t,[150,-150],r)},N=function(t,r){return T(t,[120,-120],r)},V=function(t,r){return T(t,[60,-120,180],r)},U=function(t,r){return T(t,[90,-90,180],r)},$=Object.entries(t).reduce((function(r,e){var n=e[0],o=e[1];if(n!==t.HEX){var i=x(n.split(""));r[i]=o,r["A"+i]=o}return r}),{}),q=function(r){return"string"==typeof r?function(r){var e;if(Object.keys(t).some((function(t){if(p[t].test(r))return e=t,!0})),!e&&~f.indexOf(r)&&(e=t.HEX),!e)throw new Error(y);return e}(r):function(r){var e,n=!1,o=x(Object.keys(r));if($[o]&&(e=$[o]),e&&e===t.RGB){var i=Object.entries(r).some((function(t){return!F.test("".concat(t[1]))})),a=Object.entries(r).some((function(t){return!(b.test("".concat(t[1]))||!F.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));i&&a&&(n=!0),i||(e=t.HEX)}if(!e||n)throw new Error(m);return e}(r)},Q=((c={})[t.HEX]=function(t){var r=(~f.indexOf(t)?n[t]:t).match(p.HEX),e={r:R(r[1]||r[5]),g:R(r[2]||r[6]),b:R(r[3]||r[7])},o=r[4]||r[8];return void 0!==o&&(e.a=R(o)/255),e},c[t.RGB]=function(t){var r=t.match(p.RGB),e=G(r[1]||r[5]),n=G(r[2]||r[6]),o=G(r[3]||r[7]),i=r[4]||r[8],a={r:Math.min(e,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==i&&(a.a=Y(i)),a},c[t.HSL]=function(t){var r=t.match(p.HSL),e=I(r[1]||r[5]),n=D(r[2]||r[6]),o=D(r[3]||r[7]),i=r[4]||r[8],a=E(e,n,o);return void 0!==i&&(a.a=Y(i)),a},c[t.CMYK]=function(t){var r=t.match(p.CMYK),e=k(r[1]||r[6]),n=k(r[2]||r[7]),o=k(r[3]||r[8]),i=k(r[4]||r[9]),a=r[5]||r[10],u=H(e,n,o,i);return void 0!==a&&(u.a=Y(a)),u},c),_=((s={})[t.HEX]=function(t){var r={r:G("".concat(t.r)),g:G("".concat(t.g)),b:G("".concat(t.b))};return C(t,"a")&&(r.a=Math.min(G("".concat(t.a),!0),1)),r},s[t.RGB]=function(t){return this.HEX(t)},s[t.HSL]=function(t){var r=D("".concat(t.s)),e=D("".concat(t.l)),n=E(I(t.h),r,e);return C(t,"a")&&(n.a=Y(t.a)),n},s[t.CMYK]=function(t){var r=k("".concat(t.c)),e=k("".concat(t.m)),n=k("".concat(t.y)),o=k("".concat(t.k)),i=H(r,e,n,o);return C(t,"a")&&(i.a=Y(t.a)),i},s),z=function(t,r){return void 0===r&&(r=q(t)),"string"==typeof t?Q[r](t):_[r](t)},J=((d={})[t.HEX]=function(t){return{r:S(t.r),g:S(t.g),b:S(t.b)}},d.HEXA=function(t){var r=J.HEX(t);return r.a=C(t,"a")?S(255*t.a):"0xFF",r},d[t.RGB]=function(t){return C(t,"a")&&delete t.a,t},d.RGBA=function(t){return t.a=C(t,"a")?O(t.a,2):1,t},d[t.HSL]=function(t){var r=B(t.r,t.g,t.b);return delete r.a,r},d.HSLA=function(t){var r=J.HSL(t);return r.a=C(t,"a")?O(t.a,2):1,r},d[t.CMYK]=function(t){return v(t.r,t.g,t.b)},d.CMYKA=function(t){var r=v(t.r,t.g,t.b);return r.a=C(t,"a")?O(t.a,2):1,r},d),W=function(r,e,n){var i=q(r),a="string"==typeof r,u=z(r,i),c="string"==typeof r&&C(u,"a")||"string"!=typeof r&&C(r,"a"),s=B(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(e+1):(100-s.l)/(e+1),l=Array(e).fill(null).map((function(t,r){return o(o({},s),{l:s.l+d*(r+1)*(1-2*+n)})}));switch(i){case t.HEX:default:return l.map((function(t){var r=E(t.h,t.s,t.l);return c&&(r.a=t.a),a?c?j.HEX(o(o({},r),{a:O(255*r.a,2)})):j.HEX(r):c?J.HEXA(r):J.HEX(r)}));case t.RGB:return l.map((function(t){var r=E(t.h,t.s,t.l);return c&&(r.a=t.a),a?j.RGB(r):c?J.RGBA(r):J.RGB(r)}));case t.HSL:return l.map((function(t){return a?j.HSL(t):c?J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:t.a})):J.HSL(E(t.h,t.s,t.l))}))}},Z=((l={buildHarmony:function(r,e,n){var o=q(r),i=z(r,o),a=B(i.r,i.g,i.b,i.a),u="string"==typeof r&&C(i,"a")||"string"!=typeof r&&C(r,"a"),c="string"==typeof r;switch(o){case t.HEX:default:return u?this.HEXA(a,e,n,c):this.HEX(a,e,n,c);case t.HSL:return u?this.HSLA(a,e,n,c):this.HSL(a,e,n,c);case t.RGB:return u?this.RGBA(a,e,n,c):this.RGB(a,e,n,c)}}})[t.HEX]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HEX(E(t.h,t.s,t.l)):J.HEX(E(t.h,t.s,t.l))}))},l.HEXA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HEX(o(o({},E(t.h,t.s,t.l)),{a:255*Y(t.a)})):J.HEXA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l[t.RGB]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.RGB(E(t.h,t.s,t.l)):J.RGB(E(t.h,t.s,t.l))}))},l.RGBA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.RGB(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)})):J.RGBA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l[t.HSL]=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HSL({h:t.h,s:t.s,l:t.l}):J.HSL(E(t.h,t.s,t.l))}))},l.HSLA=function(t,r,e,n){return r(t,e).map((function(t){return n?j.HSL(o(o({},t),{a:Y(t.a)})):J.HSLA(o(o({},E(t.h,t.s,t.l)),{a:Y(t.a)}))}))},l),tt=((h={mix:function(t,r){var e,n,i,a,u,c,s,d,l,h,f,p,g,b,F,y=t.map((function(t){var r=q(t);return z(t,r)})),m=r===exports.Mix.SUBTRACTIVE?y.map((function(t){var r,e,n,o,i,a,u,c,s,d,l,h,f,p,g=(r=t.r,e=t.g,n=t.b,o=Math.min(r,e,n),i=Math.min(255-r,255-e,255-n),a=r-o,u=e-o,c=n-o,s=Math.min(a,u),d=a-s,l=(u+s)/2,h=(c+u-s)/2,f=Math.max(d,l,h)/Math.max(a,u,c),p=isNaN(f)||f===1/0||f<=0?1:f,{r:d/p+i,y:l/p+i,b:h/p+i});return C(t,"a")&&(g.a=t.a),g})):null;function A(t){var e=r===exports.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return t.reduce((function(t,e){var n=C(e,"a")?e.a:1,i={r:Math.min(t.r+e.r*n,255),b:Math.min(t.b+e.b*n,255),a:1-(1-n)*(1-t.a)},a="g"in t?t.g:t.y,u="g"in e?e.g:e.y;return o(o({},i),r===exports.Mix.ADDITIVE?{g:Math.min(a+u*n,255)}:{y:Math.min(a+u*n,255)})}),e)}if(r===exports.Mix.ADDITIVE)e=A(y);else{var E=A(m);n=E.r,i=E.y,a=E.b,u=Math.min(n,i,a),c=Math.min(255-n,255-i,255-a),s=n-u,d=i-u,l=a-u,h=Math.min(d,l),f=s+d-h,p=d+h,g=2*(l-h),b=Math.max(f,p,g)/Math.max(s,d,l),F=isNaN(b)||b===1/0||b<=0?1:b,(e={r:f/F+c,g:p/F+c,b:g/F+c}).a=E.a}return{r:O(e.r,2),g:O(e.g,2),b:O(e.b,2),a:X(e.a,0,1)}}})[t.HEX]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?j.HEX(n):J.HEX(n)},h.HEXA=function(t,r,e){var n=this.mix(t,r);return n.a=e?255*Y(n.a):Y(n.a),e?j.HEX(n):J.HEXA(n)},h[t.RGB]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?j.RGB(n):J.RGB(n)},h.RGBA=function(t,r,e){var n=this.mix(t,r);return e?j.RGB(n):J.RGBA(n)},h[t.HSL]=function(t,r,e){var n=this.mix(t,r),o=B(n.r,n.g,n.b);return delete n.a,delete o.a,e?j.HSL(o):J.HSL(n)},h.HSLA=function(t,r,e){var n=this.mix(t,r),o=B(n.r,n.g,n.b,n.a);return e?j.HSL(o):J.HSLA(n)},h),rt=function(t,r,e,n,o){var i=n(z(t,r));return e?o(i):i},et=function(t,r,e,n,o,i){e<1&&(e=5);var a=function(t,r,e){var n=e-1,o=(r.r-t.r)/n,i=(r.g-t.g)/n,a=(r.b-t.b)/n,u=Y(t.a),c=(Y(r.a)-u)/n;return Array(e).fill(null).map((function(e,s){return 0===s?t:s===n?r:{r:O(t.r+o*s),g:O(t.g+i*s),b:O(t.b+a*s),a:O(u+c*s,2)}}))}(z(t),z(r),e);return a.map((function(t){var r=o(t);return n?i(r):r}))},nt=function(){function t(t){this.rgb=z(t),this.updateHSL(),this.updateCMYK()}return t.prototype.updateRGB=function(){this.rgb=o(o({},E(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},t.prototype.updateRGBFromCMYK=function(){this.rgb=o(o({},H(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},t.prototype.updateHSL=function(){this.hsl=B(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},t.prototype.updateCMYK=function(){this.cmyk=v(this.rgb.r,this.rgb.g,this.rgb.b)},t.prototype.updateRGBAndCMYK=function(){return this.updateRGB(),this.updateCMYK(),this},t.prototype.updateHSLAndCMYK=function(){return this.updateHSL(),this.updateCMYK(),this},t.prototype.updateRGBAndHSL=function(){return this.updateRGBFromCMYK(),this.updateHSL(),this},t.prototype.setH=function(t){return this.hsl.h=I(t),this.updateRGBAndCMYK()},t.prototype.setS=function(t){return this.hsl.s=X(t,0,100),this.updateRGBAndCMYK()},t.prototype.setL=function(t){return this.hsl.l=X(t,0,100),this.updateRGBAndCMYK()},t.prototype.setR=function(t){return this.rgb.r=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setG=function(t){return this.rgb.g=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setB=function(t){return this.rgb.b=X(t,0,255),this.updateHSLAndCMYK()},t.prototype.setA=function(t){return this.hsl.a=this.rgb.a=X(t,0,1),this},t.prototype.setC=function(t){return this.cmyk.c=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setM=function(t){return this.cmyk.m=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setY=function(t){return this.cmyk.y=X(t,0,100),this.updateRGBAndHSL()},t.prototype.setK=function(t){return this.cmyk.k=X(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(t.prototype,"H",{get:function(){return O(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"S",{get:function(){return O(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"L",{get:function(){return O(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"R",{get:function(){return O(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"G",{get:function(){return O(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"B",{get:function(){return O(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"A",{get:function(){return O(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"C",{get:function(){return O(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"M",{get:function(){return O(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Y",{get:function(){return O(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"K",{get:function(){return O(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXObject",{get:function(){return J.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXAObject",{get:function(){return J.HEXA(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBObject",{get:function(){return{r:this.R,g:this.G,b:this.B}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBAObject",{get:function(){return o(o({},this.RGBObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLObject",{get:function(){return{h:this.H,s:this.S,l:this.L}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLAObject",{get:function(){return o(o({},this.HSLObject),{a:this.A})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKAObject",{get:function(){return{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEX",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return j.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HEXA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:255*this.A};return j.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGB",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return j.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"RGBA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:this.A};return j.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSL",{get:function(){var t=this.hsl,r={h:t.h,s:t.s,l:t.l};return j.HSL(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HSLA",{get:function(){return j.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYK",{get:function(){return j.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CMYKA",{get:function(){return j.CMYK(o(o({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),t.toHEX=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HEX,j.HEX)},t.toHEXA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HEXA,j.HEX)},t.toRGB=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.RGB,j.RGB)},t.toRGBA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.RGBA,j.RGB)},t.toHSL=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HSL,j.HSL)},t.toHSLA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.HSLA,j.HSL)},t.toCMYK=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.CMYK,j.CMYK)},t.toCMYKA=function(t,r){void 0===r&&(r=!0);var e=q(t);return rt(t,e,r,J.CMYKA,j.CMYK)},t.getBlendHEX=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HEX,j.HEX)},t.getBlendHEXA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HEXA,j.HEX)},t.getBlendRGB=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.RGB,j.RGB)},t.getBlendRGBA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.RGBA,j.RGB)},t.getBlendHSL=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HSL,j.HSL)},t.getBlendHSLA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),et(t,r,e,n,J.HSLA,j.HSL)},t.getMixHEX=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HEX(t,r,e)},t.getMixHEXA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HEXA(t,r,e)},t.getMixRGB=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.RGB(t,r,e)},t.getMixRGBA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.RGBA(t,r,e)},t.getMixHSL=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HSL(t,r,e)},t.getMixHSLA=function(t,r,e){return void 0===r&&(r=exports.Mix.ADDITIVE),void 0===e&&(e=!0),tt.HSLA(t,r,e)},t.getShades=function(t,r){return W(t,r,!0)},t.getTints=function(t,r){return W(t,r,!1)},t.getHarmony=function(t,r,e){switch(void 0===r&&(r=exports.Harmony.COMPLEMENTARY),void 0===e&&(e=exports.Mix.ADDITIVE),r){case exports.Harmony.ANALOGOUS:return Z.buildHarmony(t,K,e);case exports.Harmony.SPLIT_COMPLEMENTARY:return Z.buildHarmony(t,w,e);case exports.Harmony.TRIADIC:return Z.buildHarmony(t,N,e);case exports.Harmony.TETRADIC:return Z.buildHarmony(t,V,e);case exports.Harmony.SQUARE:return Z.buildHarmony(t,U,e);default:return Z.buildHarmony(t,P,e)}},t}();exports.ColorTranslator=nt; |
{ | ||
"name": "colortranslator", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "A JavaScript library, written in TypeScript, to convert among different color models", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"demo": "webpack serve --open --config webpack.demo.config.js", | ||
"docs": "webpack --config webpack.demo.publish.js --mode production", | ||
"docs": "webpack --config webpack.demo.publish.js --mode production && yarn build", | ||
"compile:regexps": "yarn plop", | ||
@@ -80,3 +80,3 @@ "prepare": "npm run build", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-ts": "^3.0.2", | ||
"rollup-plugin-ts": "^3.1.1", | ||
"sass-loader": "^13.2.0", | ||
@@ -83,0 +83,0 @@ "style-loader": "^3.3.1", |
@@ -1,1 +0,1 @@ | ||
var colortranslator=function(t){"use strict";var r,e,n,o,i=function(){return i=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},i.apply(this,arguments)};function a(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(r||(r={})),t.Harmony=void 0,(e=t.Harmony||(t.Harmony={})).ANALOGOUS="ANALOGOUS",e.COMPLEMENTARY="COMPLEMENTARY",e.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",e.TRIADIC="TRIADIC",e.TETRADIC="TETRADIC",e.SQUARE="SQUARE",t.Mix=void 0,(n=t.Mix||(t.Mix={})).ADDITIVE="ADDITIVE",n.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 u,c,s,d,l,h,f,g=Object.keys(o),p=((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),b=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,F=/^(\d+(?:\.\d+)?|\.\d+)%$/,y=/^0x([a-f\d]{1,2})$/i,m="The provided string color doesn't have a correct format",A="The provided color object doesn't have the proper keys or format",E=function(t,r,e){return e<0&&(e+=6),e>=6&&(e-=6),e<1?Math.round(255*((r-t)*e+t)):e<3?Math.round(255*r):e<4?Math.round(255*((r-t)*(4-e)+t)):Math.round(255*t)},H=function(t,r,e){r/=100;var n=(e/=100)<=.5?e*(r+1):e+r-e*r,o=2*e-n;return{r:E(o,n,(t/=60)+2),g:E(o,n,t),b:E(o,n,t-2)}},v=function(t,r,e,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-r)*n),b:Math.round(255*(1-e)*n)}},B=function(t,r,e){t/=255,r/=255,e/=255;var n=1-Math.max(t,r,e),o=1-n,i=(o-t)/o,a=(o-r)/o,u=(o-e)/o;return{c:Math.round(100*i),m:Math.round(100*a),y:Math.round(100*u),k:Math.round(100*n)}},M=function(t,r,e,n){void 0===n&&(n=1),t/=255,r/=255,e/=255,n=Math.min(n,1);var o=Math.max(t,r,e),i=Math.min(t,r,e),a=o-i,u=0,c=0,s=(o+i)/2;if(0===a)u=0,c=0;else{switch(o){case t:u=(r-e)/a%6;break;case r:u=(e-t)/a+2;break;case e:u=(t-r)/a+4}(u=Math.round(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},C=function(t,r){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var e=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],o=r?n:e,i=0,a=0,u=0,c=0;return(r?e:n).find((function(r,e){return t>=r[0]&&t<r[1]&&(i=r[0],a=r[1],u=o[e][0],c=o[e][1],!0)})),u+(c-u)/(a-i)*(t-i)},D=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},R=function(t){return F.test("".concat(t))?+"".concat(t).replace(F,"$1"):Math.min(+t,100)},S=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},L=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length?"0x0".concat(r):"0x".concat(r)},G=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length&&(r="0".concat(r)),r},k=function(t,r){return void 0===r&&(r=!1),!r&&F.test(t)?Math.min(255*+t.replace(F,"$1")/100,255):y.test(t)?3===t.length?r?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):r?parseInt(t)/255:parseInt(t):Math.min(+t,r?1:255)},O=function(t){return Math.min(F.test(t)?+t.replace(F,"$1")/100:+t,1)},X=function(t){return t.sort().join("").toUpperCase()},j=function(t,r){void 0===r&&(r=0);var e=Math.pow(10,r);return Math.round(+t*e)/e},I=function(t,r,e){return Math.max(r,Math.min(t,e))},Y=((c={})[r.HEX]=function(t){return"#".concat(G(t.r)).concat(G(t.g)).concat(G(t.b)).concat(D(t,"a")&&G(t.a)||"")},c[r.RGB]=function(t){return"rgb".concat(D(t,"a")?"a":"","(").concat(j(t.r),",").concat(j(t.g),",").concat(j(t.b)).concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c[r.HSL]=function(t){return"hsl".concat(D(t,"a")?"a":"","(").concat(j(t.h),",").concat(j(t.s),"%,").concat(j(t.l),"%").concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c[r.CMYK]=function(t){return"cmyk(".concat(j(t.c),"%,").concat(j(t.m),"%,").concat(j(t.y),"%,").concat(j(t.k),"%").concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c),x=function(t){if("string"==typeof t){var r=t.match(b),e=+r[1];switch(r[2]){case"rad":t=Math.round(180*e/Math.PI);break;case"turn":t=Math.round(360*e);break;default:t=e}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},T=function(t){return"string"==typeof t&&(t=F.test(t)?+t.replace(F,"$1")/100:+t),isNaN(+t)||t>1?1:j(t,2)},K=function(r,e,n){return e.reduce((function(e,o){return a(a([],e,!0),[i(i({},r),{h:n===t.Mix.ADDITIVE?x(r.h+o):x(C(C(r.h,!1)+o,!0))})],!1)}),[i({},r)])},P=function(t,r){return K(t,[30,-30],r)},w=function(t,r){return K(t,[180],r)},N=function(t,r){return K(t,[150,-150],r)},V=function(t,r){return K(t,[120,-120],r)},U=function(t,r){return K(t,[60,-120,180],r)},$=function(t,r){return K(t,[90,-90,180],r)},q=Object.entries(r).reduce((function(t,e){var n=e[0],o=e[1];if(n!==r.HEX){var i=X(n.split(""));t[i]=o,t["A"+i]=o}return t}),{}),Q=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(r).some((function(r){if(p[r].test(t))return e=r,!0})),!e&&~g.indexOf(t)&&(e=r.HEX),!e)throw new Error(m);return e}(t):function(t){var e,n=!1,o=X(Object.keys(t));if(q[o]&&(e=q[o]),e&&e===r.RGB){var i=Object.entries(t).some((function(t){return!y.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(F.test("".concat(t[1]))||!y.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));i&&a&&(n=!0),i||(e=r.HEX)}if(!e||n)throw new Error(A);return e}(t)},_=((s={})[r.HEX]=function(t){var r=(~g.indexOf(t)?o[t]:t).match(p.HEX),e={r:S(r[1]||r[5]),g:S(r[2]||r[6]),b:S(r[3]||r[7])},n=r[4]||r[8];return void 0!==n&&(e.a=S(n)/255),e},s[r.RGB]=function(t){var r=t.match(p.RGB),e=k(r[1]||r[5]),n=k(r[2]||r[6]),o=k(r[3]||r[7]),i=r[4]||r[8],a={r:Math.min(e,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==i&&(a.a=T(i)),a},s[r.HSL]=function(t){var r=t.match(p.HSL),e=x(r[1]||r[5]),n=R(r[2]||r[6]),o=R(r[3]||r[7]),i=r[4]||r[8],a=H(e,n,o);return void 0!==i&&(a.a=T(i)),a},s[r.CMYK]=function(t){var r=t.match(p.CMYK),e=O(r[1]||r[6]),n=O(r[2]||r[7]),o=O(r[3]||r[8]),i=O(r[4]||r[9]),a=r[5]||r[10],u=v(e,n,o,i);return void 0!==a&&(u.a=T(a)),u},s),z=((d={})[r.HEX]=function(t){var r={r:k("".concat(t.r)),g:k("".concat(t.g)),b:k("".concat(t.b))};return D(t,"a")&&(r.a=Math.min(k("".concat(t.a),!0),1)),r},d[r.RGB]=function(t){return this.HEX(t)},d[r.HSL]=function(t){var r=R("".concat(t.s)),e=R("".concat(t.l)),n=H(x(t.h),r,e);return D(t,"a")&&(n.a=T(t.a)),n},d[r.CMYK]=function(t){var r=O("".concat(t.c)),e=O("".concat(t.m)),n=O("".concat(t.y)),o=O("".concat(t.k)),i=v(r,e,n,o);return D(t,"a")&&(i.a=T(t.a)),i},d),J=function(t,r){return void 0===r&&(r=Q(t)),"string"==typeof t?_[r](t):z[r](t)},W=((l={})[r.HEX]=function(t){return{r:L(t.r),g:L(t.g),b:L(t.b)}},l.HEXA=function(t){var r=W.HEX(t);return r.a=D(t,"a")?L(255*t.a):"0xFF",r},l[r.RGB]=function(t){return D(t,"a")&&delete t.a,t},l.RGBA=function(t){return t.a=D(t,"a")?j(t.a,2):1,t},l[r.HSL]=function(t){var r=M(t.r,t.g,t.b);return delete r.a,r},l.HSLA=function(t){var r=W.HSL(t);return r.a=D(t,"a")?j(t.a,2):1,r},l[r.CMYK]=function(t){return B(t.r,t.g,t.b)},l.CMYKA=function(t){var r=B(t.r,t.g,t.b);return r.a=D(t,"a")?j(t.a,2):1,r},l),Z=function(t,e,n){var o=Q(t),a="string"==typeof t,u=J(t,o),c="string"==typeof t&&D(u,"a")||"string"!=typeof t&&D(t,"a"),s=M(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(e+1):(100-s.l)/(e+1),l=Array(e).fill(null).map((function(t,r){return i(i({},s),{l:s.l+d*(r+1)*(1-2*+n)})}));switch(o){case r.HEX:default:return l.map((function(t){var r=H(t.h,t.s,t.l);return c&&(r.a=t.a),a?c?Y.HEX(i(i({},r),{a:j(255*r.a,2)})):Y.HEX(r):c?W.HEXA(r):W.HEX(r)}));case r.RGB:return l.map((function(t){var r=H(t.h,t.s,t.l);return c&&(r.a=t.a),a?Y.RGB(r):c?W.RGBA(r):W.RGB(r)}));case r.HSL:return l.map((function(t){return a?Y.HSL(t):c?W.HSLA(i(i({},H(t.h,t.s,t.l)),{a:t.a})):W.HSL(H(t.h,t.s,t.l))}))}},tt=((h={buildHarmony:function(t,e,n){var o=Q(t),i=J(t,o),a=M(i.r,i.g,i.b,i.a),u="string"==typeof t&&D(i,"a")||"string"!=typeof t&&D(t,"a"),c="string"==typeof t;switch(o){case r.HEX:default:return u?this.HEXA(a,e,n,c):this.HEX(a,e,n,c);case r.HSL:return u?this.HSLA(a,e,n,c):this.HSL(a,e,n,c);case r.RGB:return u?this.RGBA(a,e,n,c):this.RGB(a,e,n,c)}}})[r.HEX]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HEX(H(t.h,t.s,t.l)):W.HEX(H(t.h,t.s,t.l))}))},h.HEXA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HEX(i(i({},H(t.h,t.s,t.l)),{a:255*T(t.a)})):W.HEXA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[r.RGB]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.RGB(H(t.h,t.s,t.l)):W.RGB(H(t.h,t.s,t.l))}))},h.RGBA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.RGB(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)})):W.RGBA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[r.HSL]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HSL({h:t.h,s:t.s,l:t.l}):W.HSL(H(t.h,t.s,t.l))}))},h.HSLA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HSL(i(i({},t),{a:T(t.a)})):W.HSLA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h),rt=((f={mix:function(r,e){var n,o,a,u,c,s,d,l,h,f,g,p,b,F,y,m=r.map((function(t){var r=Q(t);return J(t,r)})),A=e===t.Mix.SUBTRACTIVE?m.map((function(t){var r,e,n,o,i,a,u,c,s,d,l,h,f,g,p=(r=t.r,e=t.g,n=t.b,o=Math.min(r,e,n),i=Math.min(255-r,255-e,255-n),a=r-o,u=e-o,c=n-o,s=Math.min(a,u),d=a-s,l=(u+s)/2,h=(c+u-s)/2,f=Math.max(d,l,h)/Math.max(a,u,c),g=isNaN(f)||f===1/0||f<=0?1:f,{r:d/g+i,y:l/g+i,b:h/g+i});return D(t,"a")&&(p.a=t.a),p})):null;function E(r){var n=e===t.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return r.reduce((function(r,n){var o=D(n,"a")?n.a:1,a={r:Math.min(r.r+n.r*o,255),b:Math.min(r.b+n.b*o,255),a:1-(1-o)*(1-r.a)},u="g"in r?r.g:r.y,c="g"in n?n.g:n.y;return i(i({},a),e===t.Mix.ADDITIVE?{g:Math.min(u+c*o,255)}:{y:Math.min(u+c*o,255)})}),n)}if(e===t.Mix.ADDITIVE)n=E(m);else{var H=E(A);o=H.r,a=H.y,u=H.b,c=Math.min(o,a,u),s=Math.min(255-o,255-a,255-u),d=o-c,l=a-c,h=u-c,f=Math.min(l,h),g=d+l-f,p=l+2*f,b=2*(h-f),F=Math.max(g,p,b)/Math.max(d,l,h),y=isNaN(F)||F===1/0||F<=0?1:F,(n={r:g/y+s,g:p/y+s,b:b/y+s}).a=H.a}return{r:j(n.r,2),g:j(n.g,2),b:j(n.b,2),a:I(n.a,0,1)}}})[r.HEX]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?Y.HEX(n):W.HEX(n)},f.HEXA=function(t,r,e){var n=this.mix(t,r);return n.a=e?255*T(n.a):T(n.a),e?Y.HEX(n):W.HEXA(n)},f[r.RGB]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?Y.RGB(n):W.RGB(n)},f.RGBA=function(t,r,e){var n=this.mix(t,r);return e?Y.RGB(n):W.RGBA(n)},f[r.HSL]=function(t,r,e){var n=this.mix(t,r),o=M(n.r,n.g,n.b);return delete n.a,delete o.a,e?Y.HSL(o):W.HSL(n)},f.HSLA=function(t,r,e){var n=this.mix(t,r),o=M(n.r,n.g,n.b,n.a);return e?Y.HSL(o):W.HSLA(n)},f),et=function(t,r,e,n,o){var i=n(J(t,r));return e?o(i):i},nt=function(t,r,e,n,o,i){e<1&&(e=5);var a=function(t,r,e){var n=e-1,o=(r.r-t.r)/n,i=(r.g-t.g)/n,a=(r.b-t.b)/n,u=T(t.a),c=(T(r.a)-u)/n;return Array(e).fill(null).map((function(e,s){return 0===s?t:s===n?r:{r:j(t.r+o*s),g:j(t.g+i*s),b:j(t.b+a*s),a:j(u+c*s,2)}}))}(J(t),J(r),e);return a.map((function(t){var r=o(t);return n?i(r):r}))},ot=function(){function r(t){this.rgb=J(t),this.updateHSL(),this.updateCMYK()}return r.prototype.updateRGB=function(){this.rgb=i(i({},H(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},r.prototype.updateRGBFromCMYK=function(){this.rgb=i(i({},v(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},r.prototype.updateHSL=function(){this.hsl=M(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},r.prototype.updateCMYK=function(){this.cmyk=B(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.setH=function(t){return this.hsl.h=x(t),this.updateRGBAndCMYK()},r.prototype.setS=function(t){return this.hsl.s=I(t,0,100),this.updateRGBAndCMYK()},r.prototype.setL=function(t){return this.hsl.l=I(t,0,100),this.updateRGBAndCMYK()},r.prototype.setR=function(t){return this.rgb.r=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setG=function(t){return this.rgb.g=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setB=function(t){return this.rgb.b=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setA=function(t){return this.hsl.a=this.rgb.a=I(t,0,1),this},r.prototype.setC=function(t){return this.cmyk.c=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setM=function(t){return this.cmyk.m=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setY=function(t){return this.cmyk.y=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setK=function(t){return this.cmyk.k=I(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(r.prototype,"H",{get:function(){return j(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"S",{get:function(){return j(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"L",{get:function(){return j(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"R",{get:function(){return j(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"G",{get:function(){return j(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"B",{get:function(){return j(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"A",{get:function(){return j(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"C",{get:function(){return j(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"M",{get:function(){return j(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Y",{get:function(){return j(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"K",{get:function(){return j(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXObject",{get:function(){return W.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXAObject",{get:function(){return W.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 i(i({},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 i(i({},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{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEX",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return Y.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:255*this.A};return Y.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGB",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return Y.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:this.A};return Y.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSL",{get:function(){var t=this.hsl,r={h:t.h,s:t.s,l:t.l};return Y.HSL(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLA",{get:function(){return Y.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYK",{get:function(){return Y.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKA",{get:function(){return Y.CMYK(i(i({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),r.toHEX=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HEX,Y.HEX)},r.toHEXA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HEXA,Y.HEX)},r.toRGB=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.RGB,Y.RGB)},r.toRGBA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.RGBA,Y.RGB)},r.toHSL=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HSL,Y.HSL)},r.toHSLA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HSLA,Y.HSL)},r.toCMYK=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.CMYK,Y.CMYK)},r.toCMYKA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.CMYKA,Y.CMYK)},r.getBlendHEX=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HEX,Y.HEX)},r.getBlendHEXA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HEXA,Y.HEX)},r.getBlendRGB=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.RGB,Y.RGB)},r.getBlendRGBA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.RGBA,Y.RGB)},r.getBlendHSL=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HSL,Y.HSL)},r.getBlendHSLA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HSLA,Y.HSL)},r.getMixHEX=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HEX(r,e,n)},r.getMixHEXA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HEXA(r,e,n)},r.getMixRGB=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.RGB(r,e,n)},r.getMixRGBA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.RGBA(r,e,n)},r.getMixHSL=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HSL(r,e,n)},r.getMixHSLA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HSLA(r,e,n)},r.getShades=function(t,r){return Z(t,r,!0)},r.getTints=function(t,r){return Z(t,r,!1)},r.getHarmony=function(r,e,n){switch(void 0===e&&(e=t.Harmony.COMPLEMENTARY),void 0===n&&(n=t.Mix.ADDITIVE),e){case t.Harmony.ANALOGOUS:return tt.buildHarmony(r,P,n);case t.Harmony.SPLIT_COMPLEMENTARY:return tt.buildHarmony(r,N,n);case t.Harmony.TRIADIC:return tt.buildHarmony(r,V,n);case t.Harmony.TETRADIC:return tt.buildHarmony(r,U,n);case t.Harmony.SQUARE:return tt.buildHarmony(r,$,n);default:return tt.buildHarmony(r,w,n)}},r}();return t.ColorTranslator=ot,t}({}); | ||
var colortranslator=function(t){"use strict";var r,e,n,o,i=function(){return i=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t},i.apply(this,arguments)};function a(t,r,e){if(e||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return t.concat(n||Array.prototype.slice.call(r))}!function(t){t.HEX="HEX",t.RGB="RGB",t.HSL="HSL",t.CMYK="CMYK"}(r||(r={})),t.Harmony=void 0,(e=t.Harmony||(t.Harmony={})).ANALOGOUS="ANALOGOUS",e.COMPLEMENTARY="COMPLEMENTARY",e.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",e.TRIADIC="TRIADIC",e.TETRADIC="TETRADIC",e.SQUARE="SQUARE",t.Mix=void 0,(n=t.Mix||(t.Mix={})).ADDITIVE="ADDITIVE",n.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 u,c,s,d,l,h,f,g=Object.keys(o),p=((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),b=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,F=/^(\d+(?:\.\d+)?|\.\d+)%$/,y=/^0x([a-f\d]{1,2})$/i,m="The provided string color doesn't have a correct format",A="The provided color object doesn't have the proper keys or format",E=function(t,r,e){return e<0&&(e+=6),e>=6&&(e-=6),e<1?Math.round(255*((r-t)*e+t)):e<3?Math.round(255*r):e<4?Math.round(255*((r-t)*(4-e)+t)):Math.round(255*t)},H=function(t,r,e){r/=100;var n=(e/=100)<=.5?e*(r+1):e+r-e*r,o=2*e-n;return{r:E(o,n,(t/=60)+2),g:E(o,n,t),b:E(o,n,t-2)}},v=function(t,r,e,n){return n=1-n,{r:Math.round(255*(1-t)*n),g:Math.round(255*(1-r)*n),b:Math.round(255*(1-e)*n)}},B=function(t,r,e){t/=255,r/=255,e/=255;var n=1-Math.max(t,r,e),o=1-n,i=(o-t)/o,a=(o-r)/o,u=(o-e)/o;return{c:Math.round(100*i),m:Math.round(100*a),y:Math.round(100*u),k:Math.round(100*n)}},M=function(t,r,e,n){void 0===n&&(n=1),t/=255,r/=255,e/=255,n=Math.min(n,1);var o=Math.max(t,r,e),i=Math.min(t,r,e),a=o-i,u=0,c=0,s=(o+i)/2;if(0===a)u=0,c=0;else{switch(o){case t:u=(r-e)/a%6;break;case r:u=(e-t)/a+2;break;case e:u=(t-r)/a+4}(u=Math.round(60*u))<0&&(u+=360),c=a/(1-Math.abs(2*s-1))}return{h:u,s:Math.round(100*c),l:Math.round(100*s),a:n}},C=function(t,r){if(t<0&&(t+=360),t>360&&(t-=360),360===t||0===t)return t;var e=[[0,120],[120,180],[180,240],[240,360]],n=[[0,60],[60,120],[120,240],[240,360]],o=r?n:e,i=0,a=0,u=0,c=0;return(r?e:n).find((function(r,e){return t>=r[0]&&t<r[1]&&(i=r[0],a=r[1],u=o[e][0],c=o[e][1],!0)})),u+(c-u)/(a-i)*(t-i)},D=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},R=function(t){return F.test("".concat(t))?+"".concat(t).replace(F,"$1"):Math.min(+t,100)},S=function(t){return 1===t.length&&(t+=t),parseInt(t,16)},L=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length?"0x0".concat(r):"0x".concat(r)},G=function(t){var r=parseInt("".concat(t)).toString(16).toUpperCase();return 1===r.length&&(r="0".concat(r)),r},k=function(t,r){return void 0===r&&(r=!1),!r&&F.test(t)?Math.min(255*+t.replace(F,"$1")/100,255):y.test(t)?3===t.length?r?parseInt(t+t.slice(-1))/255:parseInt(t+t.slice(-1)):r?parseInt(t)/255:parseInt(t):Math.min(+t,r?1:255)},O=function(t){return Math.min(F.test(t)?+t.replace(F,"$1")/100:+t,1)},X=function(t){return t.sort().join("").toUpperCase()},j=function(t,r){void 0===r&&(r=0);var e=Math.pow(10,r);return Math.round(+t*e)/e},I=function(t,r,e){return Math.max(r,Math.min(t,e))},Y=((c={})[r.HEX]=function(t){return"#".concat(G(t.r)).concat(G(t.g)).concat(G(t.b)).concat(D(t,"a")&&G(t.a)||"")},c[r.RGB]=function(t){return"rgb".concat(D(t,"a")?"a":"","(").concat(j(t.r),",").concat(j(t.g),",").concat(j(t.b)).concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c[r.HSL]=function(t){return"hsl".concat(D(t,"a")?"a":"","(").concat(j(t.h),",").concat(j(t.s),"%,").concat(j(t.l),"%").concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c[r.CMYK]=function(t){return"cmyk(".concat(j(t.c),"%,").concat(j(t.m),"%,").concat(j(t.y),"%,").concat(j(t.k),"%").concat(D(t,"a")&&",".concat(j(t.a,2))||"",")")},c),x=function(t){if("string"==typeof t){var r=t.match(b),e=+r[1];switch(r[2]){case"rad":t=Math.round(180*e/Math.PI);break;case"turn":t=Math.round(360*e);break;default:t=e}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},T=function(t){return"string"==typeof t&&(t=F.test(t)?+t.replace(F,"$1")/100:+t),isNaN(+t)||t>1?1:j(t,2)},K=function(r,e,n){return e.reduce((function(e,o){return a(a([],e,!0),[i(i({},r),{h:n===t.Mix.ADDITIVE?x(r.h+o):x(C(C(r.h,!1)+o,!0))})],!1)}),[i({},r)])},P=function(t,r){return K(t,[30,-30],r)},w=function(t,r){return K(t,[180],r)},N=function(t,r){return K(t,[150,-150],r)},V=function(t,r){return K(t,[120,-120],r)},U=function(t,r){return K(t,[60,-120,180],r)},$=function(t,r){return K(t,[90,-90,180],r)},q=Object.entries(r).reduce((function(t,e){var n=e[0],o=e[1];if(n!==r.HEX){var i=X(n.split(""));t[i]=o,t["A"+i]=o}return t}),{}),Q=function(t){return"string"==typeof t?function(t){var e;if(Object.keys(r).some((function(r){if(p[r].test(t))return e=r,!0})),!e&&~g.indexOf(t)&&(e=r.HEX),!e)throw new Error(m);return e}(t):function(t){var e,n=!1,o=X(Object.keys(t));if(q[o]&&(e=q[o]),e&&e===r.RGB){var i=Object.entries(t).some((function(t){return!y.test("".concat(t[1]))})),a=Object.entries(t).some((function(t){return!(F.test("".concat(t[1]))||!y.test("".concat(t[1]))&&!isNaN(+t[1])&&+t[1]<=255)}));i&&a&&(n=!0),i||(e=r.HEX)}if(!e||n)throw new Error(A);return e}(t)},_=((s={})[r.HEX]=function(t){var r=(~g.indexOf(t)?o[t]:t).match(p.HEX),e={r:S(r[1]||r[5]),g:S(r[2]||r[6]),b:S(r[3]||r[7])},n=r[4]||r[8];return void 0!==n&&(e.a=S(n)/255),e},s[r.RGB]=function(t){var r=t.match(p.RGB),e=k(r[1]||r[5]),n=k(r[2]||r[6]),o=k(r[3]||r[7]),i=r[4]||r[8],a={r:Math.min(e,255),g:Math.min(n,255),b:Math.min(o,255)};return void 0!==i&&(a.a=T(i)),a},s[r.HSL]=function(t){var r=t.match(p.HSL),e=x(r[1]||r[5]),n=R(r[2]||r[6]),o=R(r[3]||r[7]),i=r[4]||r[8],a=H(e,n,o);return void 0!==i&&(a.a=T(i)),a},s[r.CMYK]=function(t){var r=t.match(p.CMYK),e=O(r[1]||r[6]),n=O(r[2]||r[7]),o=O(r[3]||r[8]),i=O(r[4]||r[9]),a=r[5]||r[10],u=v(e,n,o,i);return void 0!==a&&(u.a=T(a)),u},s),z=((d={})[r.HEX]=function(t){var r={r:k("".concat(t.r)),g:k("".concat(t.g)),b:k("".concat(t.b))};return D(t,"a")&&(r.a=Math.min(k("".concat(t.a),!0),1)),r},d[r.RGB]=function(t){return this.HEX(t)},d[r.HSL]=function(t){var r=R("".concat(t.s)),e=R("".concat(t.l)),n=H(x(t.h),r,e);return D(t,"a")&&(n.a=T(t.a)),n},d[r.CMYK]=function(t){var r=O("".concat(t.c)),e=O("".concat(t.m)),n=O("".concat(t.y)),o=O("".concat(t.k)),i=v(r,e,n,o);return D(t,"a")&&(i.a=T(t.a)),i},d),J=function(t,r){return void 0===r&&(r=Q(t)),"string"==typeof t?_[r](t):z[r](t)},W=((l={})[r.HEX]=function(t){return{r:L(t.r),g:L(t.g),b:L(t.b)}},l.HEXA=function(t){var r=W.HEX(t);return r.a=D(t,"a")?L(255*t.a):"0xFF",r},l[r.RGB]=function(t){return D(t,"a")&&delete t.a,t},l.RGBA=function(t){return t.a=D(t,"a")?j(t.a,2):1,t},l[r.HSL]=function(t){var r=M(t.r,t.g,t.b);return delete r.a,r},l.HSLA=function(t){var r=W.HSL(t);return r.a=D(t,"a")?j(t.a,2):1,r},l[r.CMYK]=function(t){return B(t.r,t.g,t.b)},l.CMYKA=function(t){var r=B(t.r,t.g,t.b);return r.a=D(t,"a")?j(t.a,2):1,r},l),Z=function(t,e,n){var o=Q(t),a="string"==typeof t,u=J(t,o),c="string"==typeof t&&D(u,"a")||"string"!=typeof t&&D(t,"a"),s=M(u.r,u.g,u.b,u.a);c||delete s.a;var d=n?s.l/(e+1):(100-s.l)/(e+1),l=Array(e).fill(null).map((function(t,r){return i(i({},s),{l:s.l+d*(r+1)*(1-2*+n)})}));switch(o){case r.HEX:default:return l.map((function(t){var r=H(t.h,t.s,t.l);return c&&(r.a=t.a),a?c?Y.HEX(i(i({},r),{a:j(255*r.a,2)})):Y.HEX(r):c?W.HEXA(r):W.HEX(r)}));case r.RGB:return l.map((function(t){var r=H(t.h,t.s,t.l);return c&&(r.a=t.a),a?Y.RGB(r):c?W.RGBA(r):W.RGB(r)}));case r.HSL:return l.map((function(t){return a?Y.HSL(t):c?W.HSLA(i(i({},H(t.h,t.s,t.l)),{a:t.a})):W.HSL(H(t.h,t.s,t.l))}))}},tt=((h={buildHarmony:function(t,e,n){var o=Q(t),i=J(t,o),a=M(i.r,i.g,i.b,i.a),u="string"==typeof t&&D(i,"a")||"string"!=typeof t&&D(t,"a"),c="string"==typeof t;switch(o){case r.HEX:default:return u?this.HEXA(a,e,n,c):this.HEX(a,e,n,c);case r.HSL:return u?this.HSLA(a,e,n,c):this.HSL(a,e,n,c);case r.RGB:return u?this.RGBA(a,e,n,c):this.RGB(a,e,n,c)}}})[r.HEX]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HEX(H(t.h,t.s,t.l)):W.HEX(H(t.h,t.s,t.l))}))},h.HEXA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HEX(i(i({},H(t.h,t.s,t.l)),{a:255*T(t.a)})):W.HEXA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[r.RGB]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.RGB(H(t.h,t.s,t.l)):W.RGB(H(t.h,t.s,t.l))}))},h.RGBA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.RGB(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)})):W.RGBA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h[r.HSL]=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HSL({h:t.h,s:t.s,l:t.l}):W.HSL(H(t.h,t.s,t.l))}))},h.HSLA=function(t,r,e,n){return r(t,e).map((function(t){return n?Y.HSL(i(i({},t),{a:T(t.a)})):W.HSLA(i(i({},H(t.h,t.s,t.l)),{a:T(t.a)}))}))},h),rt=((f={mix:function(r,e){var n,o,a,u,c,s,d,l,h,f,g,p,b,F,y,m=r.map((function(t){var r=Q(t);return J(t,r)})),A=e===t.Mix.SUBTRACTIVE?m.map((function(t){var r,e,n,o,i,a,u,c,s,d,l,h,f,g,p=(r=t.r,e=t.g,n=t.b,o=Math.min(r,e,n),i=Math.min(255-r,255-e,255-n),a=r-o,u=e-o,c=n-o,s=Math.min(a,u),d=a-s,l=(u+s)/2,h=(c+u-s)/2,f=Math.max(d,l,h)/Math.max(a,u,c),g=isNaN(f)||f===1/0||f<=0?1:f,{r:d/g+i,y:l/g+i,b:h/g+i});return D(t,"a")&&(p.a=t.a),p})):null;function E(r){var n=e===t.Mix.ADDITIVE?{r:0,g:0,b:0,a:0}:{r:0,y:0,b:0,a:0};return r.reduce((function(r,n){var o=D(n,"a")?n.a:1,a={r:Math.min(r.r+n.r*o,255),b:Math.min(r.b+n.b*o,255),a:1-(1-o)*(1-r.a)},u="g"in r?r.g:r.y,c="g"in n?n.g:n.y;return i(i({},a),e===t.Mix.ADDITIVE?{g:Math.min(u+c*o,255)}:{y:Math.min(u+c*o,255)})}),n)}if(e===t.Mix.ADDITIVE)n=E(m);else{var H=E(A);o=H.r,a=H.y,u=H.b,c=Math.min(o,a,u),s=Math.min(255-o,255-a,255-u),d=o-c,l=a-c,h=u-c,f=Math.min(l,h),g=d+l-f,p=l+f,b=2*(h-f),F=Math.max(g,p,b)/Math.max(d,l,h),y=isNaN(F)||F===1/0||F<=0?1:F,(n={r:g/y+s,g:p/y+s,b:b/y+s}).a=H.a}return{r:j(n.r,2),g:j(n.g,2),b:j(n.b,2),a:I(n.a,0,1)}}})[r.HEX]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?Y.HEX(n):W.HEX(n)},f.HEXA=function(t,r,e){var n=this.mix(t,r);return n.a=e?255*T(n.a):T(n.a),e?Y.HEX(n):W.HEXA(n)},f[r.RGB]=function(t,r,e){var n=this.mix(t,r);return delete n.a,e?Y.RGB(n):W.RGB(n)},f.RGBA=function(t,r,e){var n=this.mix(t,r);return e?Y.RGB(n):W.RGBA(n)},f[r.HSL]=function(t,r,e){var n=this.mix(t,r),o=M(n.r,n.g,n.b);return delete n.a,delete o.a,e?Y.HSL(o):W.HSL(n)},f.HSLA=function(t,r,e){var n=this.mix(t,r),o=M(n.r,n.g,n.b,n.a);return e?Y.HSL(o):W.HSLA(n)},f),et=function(t,r,e,n,o){var i=n(J(t,r));return e?o(i):i},nt=function(t,r,e,n,o,i){e<1&&(e=5);var a=function(t,r,e){var n=e-1,o=(r.r-t.r)/n,i=(r.g-t.g)/n,a=(r.b-t.b)/n,u=T(t.a),c=(T(r.a)-u)/n;return Array(e).fill(null).map((function(e,s){return 0===s?t:s===n?r:{r:j(t.r+o*s),g:j(t.g+i*s),b:j(t.b+a*s),a:j(u+c*s,2)}}))}(J(t),J(r),e);return a.map((function(t){var r=o(t);return n?i(r):r}))},ot=function(){function r(t){this.rgb=J(t),this.updateHSL(),this.updateCMYK()}return r.prototype.updateRGB=function(){this.rgb=i(i({},H(this.hsl.h,this.hsl.s,this.hsl.l)),{a:this.hsl.a})},r.prototype.updateRGBFromCMYK=function(){this.rgb=i(i({},v(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k)),{a:this.rgb.a})},r.prototype.updateHSL=function(){this.hsl=M(this.rgb.r,this.rgb.g,this.rgb.b,this.rgb.a)},r.prototype.updateCMYK=function(){this.cmyk=B(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.setH=function(t){return this.hsl.h=x(t),this.updateRGBAndCMYK()},r.prototype.setS=function(t){return this.hsl.s=I(t,0,100),this.updateRGBAndCMYK()},r.prototype.setL=function(t){return this.hsl.l=I(t,0,100),this.updateRGBAndCMYK()},r.prototype.setR=function(t){return this.rgb.r=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setG=function(t){return this.rgb.g=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setB=function(t){return this.rgb.b=I(t,0,255),this.updateHSLAndCMYK()},r.prototype.setA=function(t){return this.hsl.a=this.rgb.a=I(t,0,1),this},r.prototype.setC=function(t){return this.cmyk.c=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setM=function(t){return this.cmyk.m=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setY=function(t){return this.cmyk.y=I(t,0,100),this.updateRGBAndHSL()},r.prototype.setK=function(t){return this.cmyk.k=I(t,0,100),this.updateRGBAndHSL()},Object.defineProperty(r.prototype,"H",{get:function(){return j(this.hsl.h)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"S",{get:function(){return j(this.hsl.s)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"L",{get:function(){return j(this.hsl.l)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"R",{get:function(){return j(this.rgb.r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"G",{get:function(){return j(this.rgb.g)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"B",{get:function(){return j(this.rgb.b)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"A",{get:function(){return j(this.hsl.a,2)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"C",{get:function(){return j(this.cmyk.c)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"M",{get:function(){return j(this.cmyk.m)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Y",{get:function(){return j(this.cmyk.y)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"K",{get:function(){return j(this.cmyk.k)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXObject",{get:function(){return W.HEX(this.rgb)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXAObject",{get:function(){return W.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 i(i({},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 i(i({},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{c:this.C,m:this.M,y:this.Y,k:this.K,a:this.A}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEX",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return Y.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HEXA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:255*this.A};return Y.HEX(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGB",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b};return Y.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"RGBA",{get:function(){var t=this.rgb,r={r:t.r,g:t.g,b:t.b,a:this.A};return Y.RGB(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSL",{get:function(){var t=this.hsl,r={h:t.h,s:t.s,l:t.l};return Y.HSL(r)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"HSLA",{get:function(){return Y.HSL(this.hsl)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYK",{get:function(){return Y.CMYK(this.cmyk)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"CMYKA",{get:function(){return Y.CMYK(i(i({},this.cmyk),{a:this.A}))},enumerable:!1,configurable:!0}),r.toHEX=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HEX,Y.HEX)},r.toHEXA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HEXA,Y.HEX)},r.toRGB=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.RGB,Y.RGB)},r.toRGBA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.RGBA,Y.RGB)},r.toHSL=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HSL,Y.HSL)},r.toHSLA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.HSLA,Y.HSL)},r.toCMYK=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.CMYK,Y.CMYK)},r.toCMYKA=function(t,r){void 0===r&&(r=!0);var e=Q(t);return et(t,e,r,W.CMYKA,Y.CMYK)},r.getBlendHEX=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HEX,Y.HEX)},r.getBlendHEXA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HEXA,Y.HEX)},r.getBlendRGB=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.RGB,Y.RGB)},r.getBlendRGBA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.RGBA,Y.RGB)},r.getBlendHSL=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HSL,Y.HSL)},r.getBlendHSLA=function(t,r,e,n){return void 0===e&&(e=5),void 0===n&&(n=!0),nt(t,r,e,n,W.HSLA,Y.HSL)},r.getMixHEX=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HEX(r,e,n)},r.getMixHEXA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HEXA(r,e,n)},r.getMixRGB=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.RGB(r,e,n)},r.getMixRGBA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.RGBA(r,e,n)},r.getMixHSL=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HSL(r,e,n)},r.getMixHSLA=function(r,e,n){return void 0===e&&(e=t.Mix.ADDITIVE),void 0===n&&(n=!0),rt.HSLA(r,e,n)},r.getShades=function(t,r){return Z(t,r,!0)},r.getTints=function(t,r){return Z(t,r,!1)},r.getHarmony=function(r,e,n){switch(void 0===e&&(e=t.Harmony.COMPLEMENTARY),void 0===n&&(n=t.Mix.ADDITIVE),e){case t.Harmony.ANALOGOUS:return tt.buildHarmony(r,P,n);case t.Harmony.SPLIT_COMPLEMENTARY:return tt.buildHarmony(r,N,n);case t.Harmony.TRIADIC:return tt.buildHarmony(r,V,n);case t.Harmony.TETRADIC:return tt.buildHarmony(r,U,n);case t.Harmony.SQUARE:return tt.buildHarmony(r,$,n);default:return tt.buildHarmony(r,w,n)}},r}();return t.ColorTranslator=ot,t}({}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
118096