-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 23.2 KB
/
index.js
1
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.colorGenerator=r():t.colorGenerator=r()}(this,(function(){return(()=>{var t={3740:(t,r,e)=>{var o=e(5823);t.exports=o},3827:(t,r,e)=>{var o=e(2107);t.exports=o},817:(t,r,e)=>{e(9554);var o=e(2649);t.exports=o("Array","forEach")},5302:(t,r,e)=>{e(9720);var o=e(857);t.exports=o.Object.entries},7528:(t,r,e)=>{var o=e(3740);t.exports=o},5634:(t,r,e)=>{var o=e(3827);t.exports=o},9662:(t,r,e)=>{var o=e(7854),n=e(614),i=e(6330),s=o.TypeError;t.exports=function(t){if(n(t))return t;throw s(i(t)+" is not a function")}},9670:(t,r,e)=>{var o=e(7854),n=e(111),i=o.String,s=o.TypeError;t.exports=function(t){if(n(t))return t;throw s(i(t)+" is not an object")}},8533:(t,r,e)=>{"use strict";var o=e(2092).forEach,n=e(9341)("forEach");t.exports=n?[].forEach:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}},1318:(t,r,e)=>{var o=e(5656),n=e(1400),i=e(6244),s=function(t){return function(r,e,s){var u,c=o(r),l=i(c),a=n(s,l);if(t&&e!=e){for(;l>a;)if((u=c[a++])!=u)return!0}else for(;l>a;a++)if((t||a in c)&&c[a]===e)return t||a||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},2092:(t,r,e)=>{var o=e(9974),n=e(1702),i=e(8361),s=e(7908),u=e(6244),c=e(5417),l=n([].push),a=function(t){var r=1==t,e=2==t,n=3==t,a=4==t,h=6==t,f=7==t,p=5==t||h;return function(g,v,b,x){for(var d,y,m=s(g),C=i(m),S=o(v,b),w=u(C),O=0,j=x||c,T=r?j(g,w):e||f?j(g,0):void 0;w>O;O++)if((p||O in C)&&(y=S(d=C[O],O,m),t))if(r)T[O]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return O;case 2:l(T,d)}else switch(t){case 4:return!1;case 7:l(T,d)}return h?-1:n||a?a:T}};t.exports={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6),filterReject:a(7)}},9341:(t,r,e)=>{"use strict";var o=e(7293);t.exports=function(t,r){var e=[][t];return!!e&&o((function(){e.call(null,r||function(){throw 1},1)}))}},7475:(t,r,e)=>{var o=e(7854),n=e(3157),i=e(4411),s=e(111),u=e(5112)("species"),c=o.Array;t.exports=function(t){var r;return n(t)&&(r=t.constructor,(i(r)&&(r===c||n(r.prototype))||s(r)&&null===(r=r[u]))&&(r=void 0)),void 0===r?c:r}},5417:(t,r,e)=>{var o=e(7475);t.exports=function(t,r){return new(o(t))(0===r?0:r)}},4326:(t,r,e)=>{var o=e(1702),n=o({}.toString),i=o("".slice);t.exports=function(t){return i(n(t),8,-1)}},648:(t,r,e)=>{var o=e(7854),n=e(1694),i=e(614),s=e(4326),u=e(5112)("toStringTag"),c=o.Object,l="Arguments"==s(function(){return arguments}());t.exports=n?s:function(t){var r,e,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=c(t),u))?e:l?s(r):"Object"==(o=s(r))&&i(r.callee)?"Arguments":o}},9920:(t,r,e)=>{var o=e(2597),n=e(3887),i=e(1236),s=e(3070);t.exports=function(t,r,e){for(var u=n(r),c=s.f,l=i.f,a=0;a<u.length;a++){var h=u[a];o(t,h)||e&&o(e,h)||c(t,h,l(r,h))}}},8880:(t,r,e)=>{var o=e(9781),n=e(3070),i=e(9114);t.exports=o?function(t,r,e){return n.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},9114:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},9781:(t,r,e)=>{var o=e(7293);t.exports=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,r,e)=>{var o=e(7854),n=e(111),i=o.document,s=n(i)&&n(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},8113:(t,r,e)=>{var o=e(5005);t.exports=o("navigator","userAgent")||""},7392:(t,r,e)=>{var o,n,i=e(7854),s=e(8113),u=i.process,c=i.Deno,l=u&&u.versions||c&&c.version,a=l&&l.v8;a&&(n=(o=a.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!n&&s&&(!(o=s.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=s.match(/Chrome\/(\d+)/))&&(n=+o[1]),t.exports=n},2649:(t,r,e)=>{var o=e(7854),n=e(1702);t.exports=function(t,r){return n(o[t].prototype[r])}},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,r,e)=>{var o=e(7854),n=e(1236).f,i=e(8880),s=e(1320),u=e(3505),c=e(9920),l=e(4705);t.exports=function(t,r){var e,a,h,f,p,g=t.target,v=t.global,b=t.stat;if(e=v?o:b?o[g]||u(g,{}):(o[g]||{}).prototype)for(a in r){if(f=r[a],h=t.noTargetGet?(p=n(e,a))&&p.value:e[a],!l(v?a:g+(b?".":"#")+a,t.forced)&&void 0!==h){if(typeof f==typeof h)continue;c(f,h)}(t.sham||h&&h.sham)&&i(f,"sham",!0),s(e,a,f,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9974:(t,r,e)=>{var o=e(1702),n=e(9662),i=e(4374),s=o(o.bind);t.exports=function(t,r){return n(t),void 0===r?t:i?s(t,r):function(){return t.apply(r,arguments)}}},4374:(t,r,e)=>{var o=e(7293);t.exports=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,r,e)=>{var o=e(4374),n=Function.prototype.call;t.exports=o?n.bind(n):function(){return n.apply(n,arguments)}},6530:(t,r,e)=>{var o=e(9781),n=e(2597),i=Function.prototype,s=o&&Object.getOwnPropertyDescriptor,u=n(i,"name"),c=u&&"something"===function(){}.name,l=u&&(!o||o&&s(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:l}},1702:(t,r,e)=>{var o=e(4374),n=Function.prototype,i=n.bind,s=n.call,u=o&&i.bind(s,s);t.exports=o?function(t){return t&&u(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},5005:(t,r,e)=>{var o=e(7854),n=e(614),i=function(t){return n(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?i(o[t]):o[t]&&o[t][r]}},8173:(t,r,e)=>{var o=e(9662);t.exports=function(t,r){var e=t[r];return null==e?void 0:o(e)}},7854:(t,r,e)=>{var o=function(t){return t&&t.Math==Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof e.g&&e.g)||function(){return this}()||Function("return this")()},2597:(t,r,e)=>{var o=e(1702),n=e(7908),i=o({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(n(t),r)}},3501:t=>{t.exports={}},4664:(t,r,e)=>{var o=e(9781),n=e(7293),i=e(317);t.exports=!o&&!n((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,r,e)=>{var o=e(7854),n=e(1702),i=e(7293),s=e(4326),u=o.Object,c=n("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?c(t,""):u(t)}:u},2788:(t,r,e)=>{var o=e(1702),n=e(614),i=e(5465),s=o(Function.toString);n(i.inspectSource)||(i.inspectSource=function(t){return s(t)}),t.exports=i.inspectSource},9909:(t,r,e)=>{var o,n,i,s=e(8536),u=e(7854),c=e(1702),l=e(111),a=e(8880),h=e(2597),f=e(5465),p=e(6200),g=e(3501),v="Object already initialized",b=u.TypeError,x=u.WeakMap;if(s||f.state){var d=f.state||(f.state=new x),y=c(d.get),m=c(d.has),C=c(d.set);o=function(t,r){if(m(d,t))throw new b(v);return r.facade=t,C(d,t,r),r},n=function(t){return y(d,t)||{}},i=function(t){return m(d,t)}}else{var S=p("state");g[S]=!0,o=function(t,r){if(h(t,S))throw new b(v);return r.facade=t,a(t,S,r),r},n=function(t){return h(t,S)?t[S]:{}},i=function(t){return h(t,S)}}t.exports={set:o,get:n,has:i,enforce:function(t){return i(t)?n(t):o(t,{})},getterFor:function(t){return function(r){var e;if(!l(r)||(e=n(r)).type!==t)throw b("Incompatible receiver, "+t+" required");return e}}}},3157:(t,r,e)=>{var o=e(4326);t.exports=Array.isArray||function(t){return"Array"==o(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,r,e)=>{var o=e(1702),n=e(7293),i=e(614),s=e(648),u=e(5005),c=e(2788),l=function(){},a=[],h=u("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=o(f.exec),g=!f.exec(l),v=function(t){if(!i(t))return!1;try{return h(l,a,t),!0}catch(t){return!1}},b=function(t){if(!i(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return g||!!p(f,c(t))}catch(t){return!0}};b.sham=!0,t.exports=!h||n((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?b:v},4705:(t,r,e)=>{var o=e(7293),n=e(614),i=/#|\.prototype\./,s=function(t,r){var e=c[u(t)];return e==a||e!=l&&(n(r)?o(r):!!r)},u=s.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=s.data={},l=s.NATIVE="N",a=s.POLYFILL="P";t.exports=s},111:(t,r,e)=>{var o=e(614);t.exports=function(t){return"object"==typeof t?null!==t:o(t)}},1913:t=>{t.exports=!1},2190:(t,r,e)=>{var o=e(7854),n=e(5005),i=e(614),s=e(7976),u=e(3307),c=o.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=n("Symbol");return i(r)&&s(r.prototype,c(t))}},6244:(t,r,e)=>{var o=e(7466);t.exports=function(t){return o(t.length)}},133:(t,r,e)=>{var o=e(7392),n=e(7293);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},8536:(t,r,e)=>{var o=e(7854),n=e(614),i=e(2788),s=o.WeakMap;t.exports=n(s)&&/native code/.test(i(s))},3070:(t,r,e)=>{var o=e(7854),n=e(9781),i=e(4664),s=e(3353),u=e(9670),c=e(4948),l=o.TypeError,a=Object.defineProperty,h=Object.getOwnPropertyDescriptor;r.f=n?s?function(t,r,e){if(u(t),r=c(r),u(e),"function"==typeof t&&"prototype"===r&&"value"in e&&"writable"in e&&!e.writable){var o=h(t,r);o&&o.writable&&(t[r]=e.value,e={configurable:"configurable"in e?e.configurable:o.configurable,enumerable:"enumerable"in e?e.enumerable:o.enumerable,writable:!1})}return a(t,r,e)}:a:function(t,r,e){if(u(t),r=c(r),u(e),i)try{return a(t,r,e)}catch(t){}if("get"in e||"set"in e)throw l("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},1236:(t,r,e)=>{var o=e(9781),n=e(6916),i=e(5296),s=e(9114),u=e(5656),c=e(4948),l=e(2597),a=e(4664),h=Object.getOwnPropertyDescriptor;r.f=o?h:function(t,r){if(t=u(t),r=c(r),a)try{return h(t,r)}catch(t){}if(l(t,r))return s(!n(i.f,t,r),t[r])}},8006:(t,r,e)=>{var o=e(6324),n=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return o(t,n)}},5181:(t,r)=>{r.f=Object.getOwnPropertySymbols},7976:(t,r,e)=>{var o=e(1702);t.exports=o({}.isPrototypeOf)},6324:(t,r,e)=>{var o=e(1702),n=e(2597),i=e(5656),s=e(1318).indexOf,u=e(3501),c=o([].push);t.exports=function(t,r){var e,o=i(t),l=0,a=[];for(e in o)!n(u,e)&&n(o,e)&&c(a,e);for(;r.length>l;)n(o,e=r[l++])&&(~s(a,e)||c(a,e));return a}},1956:(t,r,e)=>{var o=e(6324),n=e(748);t.exports=Object.keys||function(t){return o(t,n)}},5296:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,n=o&&!e.call({1:2},1);r.f=n?function(t){var r=o(this,t);return!!r&&r.enumerable}:e},4699:(t,r,e)=>{var o=e(9781),n=e(1702),i=e(1956),s=e(5656),u=n(e(5296).f),c=n([].push),l=function(t){return function(r){for(var e,n=s(r),l=i(n),a=l.length,h=0,f=[];a>h;)e=l[h++],o&&!u(n,e)||c(f,t?[e,n[e]]:n[e]);return f}};t.exports={entries:l(!0),values:l(!1)}},2140:(t,r,e)=>{var o=e(7854),n=e(6916),i=e(614),s=e(111),u=o.TypeError;t.exports=function(t,r){var e,o;if("string"===r&&i(e=t.toString)&&!s(o=n(e,t)))return o;if(i(e=t.valueOf)&&!s(o=n(e,t)))return o;if("string"!==r&&i(e=t.toString)&&!s(o=n(e,t)))return o;throw u("Can't convert object to primitive value")}},3887:(t,r,e)=>{var o=e(5005),n=e(1702),i=e(8006),s=e(5181),u=e(9670),c=n([].concat);t.exports=o("Reflect","ownKeys")||function(t){var r=i.f(u(t)),e=s.f;return e?c(r,e(t)):r}},857:(t,r,e)=>{var o=e(7854);t.exports=o},1320:(t,r,e)=>{var o=e(7854),n=e(614),i=e(2597),s=e(8880),u=e(3505),c=e(2788),l=e(9909),a=e(6530).CONFIGURABLE,h=l.get,f=l.enforce,p=String(String).split("String");(t.exports=function(t,r,e,c){var l,h=!!c&&!!c.unsafe,g=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet,b=c&&void 0!==c.name?c.name:r;n(e)&&("Symbol("===String(b).slice(0,7)&&(b="["+String(b).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(e,"name")||a&&e.name!==b)&&s(e,"name",b),(l=f(e)).source||(l.source=p.join("string"==typeof b?b:""))),t!==o?(h?!v&&t[r]&&(g=!0):delete t[r],g?t[r]=e:s(t,r,e)):g?t[r]=e:u(r,e)})(Function.prototype,"toString",(function(){return n(this)&&h(this).source||c(this)}))},4488:(t,r,e)=>{var o=e(7854).TypeError;t.exports=function(t){if(null==t)throw o("Can't call method on "+t);return t}},3505:(t,r,e)=>{var o=e(7854),n=Object.defineProperty;t.exports=function(t,r){try{n(o,t,{value:r,configurable:!0,writable:!0})}catch(e){o[t]=r}return r}},6200:(t,r,e)=>{var o=e(2309),n=e(9711),i=o("keys");t.exports=function(t){return i[t]||(i[t]=n(t))}},5465:(t,r,e)=>{var o=e(7854),n=e(3505),i="__core-js_shared__",s=o[i]||n(i,{});t.exports=s},2309:(t,r,e)=>{var o=e(1913),n=e(5465);(t.exports=function(t,r){return n[t]||(n[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.20.3",mode:o?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.20.3/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:(t,r,e)=>{var o=e(9303),n=Math.max,i=Math.min;t.exports=function(t,r){var e=o(t);return e<0?n(e+r,0):i(e,r)}},5656:(t,r,e)=>{var o=e(8361),n=e(4488);t.exports=function(t){return o(n(t))}},9303:t=>{var r=Math.ceil,e=Math.floor;t.exports=function(t){var o=+t;return o!=o||0===o?0:(o>0?e:r)(o)}},7466:(t,r,e)=>{var o=e(9303),n=Math.min;t.exports=function(t){return t>0?n(o(t),9007199254740991):0}},7908:(t,r,e)=>{var o=e(7854),n=e(4488),i=o.Object;t.exports=function(t){return i(n(t))}},7593:(t,r,e)=>{var o=e(7854),n=e(6916),i=e(111),s=e(2190),u=e(8173),c=e(2140),l=e(5112),a=o.TypeError,h=l("toPrimitive");t.exports=function(t,r){if(!i(t)||s(t))return t;var e,o=u(t,h);if(o){if(void 0===r&&(r="default"),e=n(o,t,r),!i(e)||s(e))return e;throw a("Can't convert object to primitive value")}return void 0===r&&(r="number"),c(t,r)}},4948:(t,r,e)=>{var o=e(7593),n=e(2190);t.exports=function(t){var r=o(t,"string");return n(r)?r:r+""}},1694:(t,r,e)=>{var o={};o[e(5112)("toStringTag")]="z",t.exports="[object z]"===String(o)},6330:(t,r,e)=>{var o=e(7854).String;t.exports=function(t){try{return o(t)}catch(t){return"Object"}}},9711:(t,r,e)=>{var o=e(1702),n=0,i=Math.random(),s=o(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++n+i,36)}},3307:(t,r,e)=>{var o=e(133);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,r,e)=>{var o=e(9781),n=e(7293);t.exports=o&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:(t,r,e)=>{var o=e(7854),n=e(2309),i=e(2597),s=e(9711),u=e(133),c=e(3307),l=n("wks"),a=o.Symbol,h=a&&a.for,f=c?a:a&&a.withoutSetter||s;t.exports=function(t){if(!i(l,t)||!u&&"string"!=typeof l[t]){var r="Symbol."+t;u&&i(a,t)?l[t]=a[t]:l[t]=c&&h?h(r):f(r)}return l[t]}},9554:(t,r,e)=>{"use strict";var o=e(2109),n=e(8533);o({target:"Array",proto:!0,forced:[].forEach!=n},{forEach:n})},9720:(t,r,e)=>{var o=e(2109),n=e(4699).entries;o({target:"Object",stat:!0},{entries:function(t){return n(t)}})},5823:(t,r,e)=>{var o=e(817);t.exports=o},2107:(t,r,e)=>{var o=e(5302);t.exports=o}},r={};function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o](i,i.exports,e),i.exports}e.d=(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";e.r(o),e.d(o,{generateColorSet:()=>n}),e(7528),e(5634);const t=new function(){this.colorToObject=function(t){return"string"!=typeof t?t:this.getValueCollection(t)};const t=function(t){return parseInt(t,16)},r=function(t){let r=t.toString(16);return 1===r.length&&(r=`0${r}`),r.toUpperCase()};this.hexToRgb=function(r){if(this.color=r,void 0!==this.color.red)return this;let e=this.color.replace("#","");3===e.length&&(e=e.split("").map((function(t){return`${t+t}`})).join(""));const o=t(e.substring(0,2)),n=t(e.substring(2,4)),i=t(e.substring(4,6));return this.color={red:o,green:n,blue:i},this},this.rgbToHex=function(t){if(this.color=this.colorToObject(t),void 0===this.color.red)throw new Error('The rgbToHex method require a "{red: XXX, green: YYY, blue: ZZZ}" object as input value');return this.color=`#${r(this.color.red)}${r(this.color.green)}${r(this.color.blue)}`,this},this.rgbToHsl=function(t){this.color=this.colorToObject(t);const r=[this.color.red/255,this.color.green/255,this.color.blue/255];r.sort((function(t,r){return t-r}));const e=r[0],o=r[1],n=r[2],i=Math.round(100*(e+n)/2);if(n===e&&o===e)return this.color={light:i,saturation:0,hue:0},this;let s,u;return s=i>50?(n-e)/(2-n-e):(n-e)/(n+e),s=Math.round(100*s),u=n===this.color.red/255?(this.color.green-this.color.blue)/255/(n-e):n===this.color.green/255?2+(this.color.blue-this.color.red)/255/(n-e):4+(this.color.red-this.color.green)/255/(n-e),u=u<0?Math.round(60*u)+360:Math.round(60*u),this.color={light:i,saturation:s,hue:u},this},this.hslToRgb=function(t){this.color=this.colorToObject(t);const r=this.color.light/100,e=this.color.saturation/100,o=this.color.hue/360;if(0===this.color.saturation){const t=Math.round(255*r);return this.color={red:t,green:t,blue:t},this}let n;n=r<.5?r*(1+e):r+e-r*e;const i=2*r-n,s=function(t,r,e){return e<0?e+=1:e>1&&(e-=1),e<1/6?t+6*(r-t)*e:e<.5?r:e<2/3?t+(r-t)*(2/3-e)*6:t},u=s(i,n,o+1/3),c=s(i,n,o),l=s(i,n,o-1/3);return this.color={red:Math.round(255*u),green:Math.round(255*c),blue:Math.round(255*l)},this},this.hexToHsl=function(t){return t=this.hexToRgb(t).getValueCollection(),t=this.rgbToHsl(t).getValueCollection(),this.color=t,this},this.hslToHex=function(t){return t=this.hslToRgb(t).getValueCollection(),t=this.rgbToHex(t).getValueCollection(),this.color=t,this},this.getString=function(t){if(t&&(this.color=t),"string"==typeof this.color)return this.color;if(void 0!==this.color.red)return`rgb(${this.color.red},${this.color.green},${this.color.blue})`;if(void 0!==this.color.hue)return`hsl(${this.color.hue},${this.color.saturation}%,${this.color.light}%)`;if(void 0!==this.color.hexred)return`#${this.color.hexred}${this.color.hexgreen}${this.color.hexblue}`;throw new Error('The getString method only takes Objects with the following keys : "hue, saturation, light" (with HSL values) - "hexblue, hexgreen, hexred" (with Hexadecimal RGB), "red, green, blue" (with base 256 RGB)')},this.getValueCollection=function(t){void 0!==t&&(this.color=t);const r=new RegExp(/^#([0-9a-f]{3}){1,2}$/i);if("object"==typeof this.color)return this.color;if(this.color.indexOf("rgb(")>-1){let t=this.color.split("(")[1].split(" ");return{red:parseInt(t[0]),green:parseInt(t[1]),blue:parseInt(t[2])}}if(this.color.indexOf("hsl(")>-1){const t=this.color.split("(")[1].split(" ");return{hue:parseInt(t[0]),saturation:parseInt(t[1]),light:parseInt(t[2])}}if(r.test(this.color)){const t=this.color;return{hexred:t.substring(1,3),hexgreen:t.substring(3,5),hexblue:t.substring(5,7)}}}};let r={linear:t=>t,easeIn:t=>1-Math.cos(3.1415*t/2),easeInHard:t=>t*t,easeInHarder:t=>t*t*t,easeOut:t=>Math.sin(3.1415*t/2),easeOutHard:t=>1-(1-t)*(1-t),easeOutHarder:t=>1-Math.pow(1-t,3),easeInOut:t=>-(Math.cos(3.1415*t)-1)/2,easeInOutHard:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInOutHarder:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2};function n(e){this.lightVariation=0,this.satVariation=10,this.hsl=t.hexToHsl(e).getValueCollection(),this.colorCollection={dominant:e,combinationCollection:[]};const o=this,n=function(t,r=0,e=100){return t<r?r:t>e?e:t},i=function(t){return t>360?t-360:t<0?t+360:t},s=function(t,e,o=10,n=0,i=0){let s=0;const u=Math.round(o/2);for(let r=1;r<=5;r++)t+(r-1)*e>100?s+=1:t-r*e<0&&(s-=1);const c=s*e+n;let l=[];for(let n=0;n<o;n++){let s;s=n<u?t-(o/2-n)*e-c:t+(n-o/2)*e-c,l[n]=Math.round(100*r[i][1](s/100))}return l},u=function(r){r.hue=i(r.hue);const e=t.hslToHex(r).getString(),n=o.colorCollection.combinationCollection;n.push({hex:e,hue:r.hue,light:r.light,saturation:r.saturation}),h();const s=n[n.length-1];s.textSubCombination=a(s.subCombination)},c=function(e,u){const c=s(e.light,o.lightVariation,o.count,o.lightMove,o.lightCurve),l=s(e.saturation,o.satVariation,o.count,o.satMove,o.satCurve),a=function(t,e=10){const n=o.hueVariation,s=o.hueCurve,u=Math.round(e/2),c=[];for(let l=0;l<e;l++){let e;const a=10*r[s][1](l/10),h=n*a;e=l<u?t-n*u+h:t+n*(a-u),c.push(i(e)+o.hueMove)}return c}(e.hue,o.count);let h=[];for(let r=0;r<o.count;r++)h[r]={hue:a[r]||e.hue,light:c[r],saturation:u?0:l[r],hex:t.hslToHex({hue:a[r]||e.hue,light:n(c[r]),saturation:u?0:n(l[r])},u).getString()};return o.full?function(t){let r=[];for(let e=0;e<10;e++){const o=Math.floor(e*t.length/10);r[e]=t[o]}return r}(h):h},l=function(t,r,e,o){let n=0,i=50;return"light"===o&&(i=60),"light"===o&&r.hue>=200&&r.hue<=300&&(i=75),n=Math.abs(r[o]-e[o])>t?e[o]:r[o]<i?r[o]+t>100?100:r[o]+t:r[o]-t<0?0:r[o]-t,n},a=function(r){Math.round(r.length/2);const e=[...r].reverse(),n=[];return r.forEach(((r,i)=>{const s=l(o.textLight,r,e[i],"light"),u=l(o.textSaturation,r,e[i],"saturation"),c={hue:e[i].hue,saturation:u,light:s},a=t.hslToHex(c).getString();c.hex=a,n.push(c)})),n},h=function(){const t=o.colorCollection.combinationCollection,r=t[t.length-1];r.subCombination=c(r)};this.updateColor=function(r){return this.colorCollection.dominant=r,r.hue?this.hsl=r:this.hsl=t.hexToHsl(r).getValueCollection(),this},this.combination=function(){const t=this.hsl;return t.hue=this.hsl.hue+180,u(t),this.colorCollection},this.splitCombination=function(){const t=this.hsl.hue,r=this.hsl;return r.hue=this.hsl.hue+210,u(r),r.hue=t,r.hue=this.hsl.hue+150,u(r),this.colorCollection},this.generate=function(t=[],{count:r=10,text:{light:e=50,saturation:o=0,hue:n=0}={},hue:{variation:i=0,curve:s=0,move:l=0}={},light:{variation:h=5,move:f=0,curve:p=0}={},saturation:{variation:g=0,move:v=0,curve:b=0}={},full:x=!0}={}){this.count=parseInt(r,10),this.hueVariation=parseInt(i,10),this.hueCurve=parseInt(s,10),this.hueMove=parseInt(l,10),this.satVariation=parseInt(g,10),this.satMove=parseInt(v,10),this.satCurve=parseInt(b,10),this.lightVariation=parseInt(h,10),this.lightMove=parseInt(f,10),this.lightCurve=parseInt(p,10),this.full=x,this.textLight=parseInt(e,10),this.textSaturation=parseInt(o,10),this.textHue=parseInt(n,10),this.colorCollection.dominantSubCollection=c(this.hsl),this.colorCollection.dominantTextSubCollection=a(this.colorCollection.dominantSubCollection),this.colorCollection.combinationCollection=[],t.forEach((t=>{const r=void 0!==t.saturation?t.saturation:this.hsl.saturation,e=void 0!==t.light?t.light:this.hsl.light,o={hue:this.hsl.hue+t.hueVariation,saturation:r,light:e};u(o)})),this.colorCollection.graySubCollection=c({hue:this.hsl.hue,saturation:0,light:this.hsl.light},!0),this.colorCollection.grayTextSubCollection=a(this.colorCollection.graySubCollection);const d=(()=>{const t=60*Math.round(this.hsl.hue/60);return Math.round((this.hsl.hue-t)/2)})();return this.colorCollection.alertSubCollection=c({hue:0+d,saturation:this.hsl.saturation,light:this.hsl.light}),this.colorCollection.alertTextSubCollection=a(this.colorCollection.alertSubCollection),this.colorCollection.warningSubCollection=c({hue:60+d,saturation:this.hsl.saturation,light:this.hsl.light}),this.colorCollection.warningTextSubCollection=a(this.colorCollection.warningSubCollection),this.colorCollection.successSubCollection=c({hue:120+2*d,saturation:this.hsl.saturation,light:this.hsl.light}),this.colorCollection.successTextSubCollection=a(this.colorCollection.successSubCollection),this.colorCollection.infoSubCollection=c({hue:240+d,saturation:this.hsl.saturation,light:this.hsl.light}),this.colorCollection.infoTextSubCollection=a(this.colorCollection.infoSubCollection),this.colorCollection}}r=Object.entries(r)})(),o})()}));