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

canvas-color-tracker

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-color-tracker - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

93

dist/canvas-color-tracker.js

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

// Version 1.2.1 canvas-color-tracker - https://github.com/vasturiano/canvas-color-tracker
// Version 1.2.2 canvas-color-tracker - https://github.com/vasturiano/canvas-color-tracker
(function (global, factory) {

@@ -8,63 +8,54 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
function _arrayWithoutHoles(r) {
if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
}
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
function _iterableToArray(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
function _toConsumableArray(r) {
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r );
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
return (String )(t);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}

@@ -1275,3 +1266,3 @@ // This file is autogenerated. It's used to publish ESM to npm.

}
_createClass(_default, [{
return _createClass(_default, [{
key: "register",

@@ -1283,3 +1274,2 @@ value: function register(obj) {

}
var idx = this.registry.length;

@@ -1305,3 +1295,2 @@ var cs = checksum(idx, this.csBits);

}]);
return _default;
}();

@@ -1308,0 +1297,0 @@

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

// Version 1.2.1 canvas-color-tracker - https://github.com/vasturiano/canvas-color-tracker
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).ColorTracker=r()}(this,(function(){"use strict";function t(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(a=n.key,i=void 0,"symbol"==typeof(i=function(t,r){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(a,"string"))?i:String(i)),n)}var a,i}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(!t)return;if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var a=/^\s+/,i=/\s+$/;function o(t,r){if(r=r||{},(t=t||"")instanceof o)return t;if(!(this instanceof o))return new o(t,r);var e=function(t){var r={r:0,g:0,b:0},e=1,o=null,s=null,f=null,h=!1,u=!1;"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(i,"").toLowerCase();var r,e=!1;if(x[t])t=x[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(r=q.rgb.exec(t))return{r:r[1],g:r[2],b:r[3]};if(r=q.rgba.exec(t))return{r:r[1],g:r[2],b:r[3],a:r[4]};if(r=q.hsl.exec(t))return{h:r[1],s:r[2],l:r[3]};if(r=q.hsla.exec(t))return{h:r[1],s:r[2],l:r[3],a:r[4]};if(r=q.hsv.exec(t))return{h:r[1],s:r[2],v:r[3]};if(r=q.hsva.exec(t))return{h:r[1],s:r[2],v:r[3],a:r[4]};if(r=q.hex8.exec(t))return{r:H(r[1]),g:H(r[2]),b:H(r[3]),a:T(r[4]),format:e?"name":"hex8"};if(r=q.hex6.exec(t))return{r:H(r[1]),g:H(r[2]),b:H(r[3]),format:e?"name":"hex"};if(r=q.hex4.exec(t))return{r:H(r[1]+""+r[1]),g:H(r[2]+""+r[2]),b:H(r[3]+""+r[3]),a:T(r[4]+""+r[4]),format:e?"name":"hex8"};if(r=q.hex3.exec(t))return{r:H(r[1]+""+r[1]),g:H(r[2]+""+r[2]),b:H(r[3]+""+r[3]),format:e?"name":"hex"};return!1}(t));"object"==n(t)&&(B(t.r)&&B(t.g)&&B(t.b)?(l=t.r,c=t.g,g=t.b,r={r:255*S(l,255),g:255*S(c,255),b:255*S(g,255)},h=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):B(t.h)&&B(t.s)&&B(t.v)?(o=C(t.s),s=C(t.v),r=function(t,r,e){t=6*S(t,360),r=S(r,100),e=S(e,100);var n=Math.floor(t),a=t-n,i=e*(1-r),o=e*(1-a*r),s=e*(1-(1-a)*r),f=n%6,h=[e,o,i,i,s,e][f],u=[s,e,e,o,i,i][f],l=[i,i,s,e,e,o][f];return{r:255*h,g:255*u,b:255*l}}(t.h,o,s),h=!0,u="hsv"):B(t.h)&&B(t.s)&&B(t.l)&&(o=C(t.s),f=C(t.l),r=function(t,r,e){var n,a,i;function o(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}if(t=S(t,360),r=S(r,100),e=S(e,100),0===r)n=a=i=e;else{var s=e<.5?e*(1+r):e+r-e*r,f=2*e-s;n=o(f,s,t+1/3),a=o(f,s,t),i=o(f,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,o,f),h=!0,u="hsl"),t.hasOwnProperty("a")&&(e=t.a));var l,c,g;return e=k(e),{ok:h,format:t.format||u,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:e}}(t);this._originalInput=t,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=r.format||e.format,this._gradientType=r.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}function s(t,r,e){t=S(t,255),r=S(r,255),e=S(e,255);var n,a,i=Math.max(t,r,e),o=Math.min(t,r,e),s=(i+o)/2;if(i==o)n=a=0;else{var f=i-o;switch(a=s>.5?f/(2-i-o):f/(i+o),i){case t:n=(r-e)/f+(r<e?6:0);break;case r:n=(e-t)/f+2;break;case e:n=(t-r)/f+4}n/=6}return{h:n,s:a,l:s}}function f(t,r,e){t=S(t,255),r=S(r,255),e=S(e,255);var n,a,i=Math.max(t,r,e),o=Math.min(t,r,e),s=i,f=i-o;if(a=0===i?0:f/i,i==o)n=0;else{switch(i){case t:n=(r-e)/f+(r<e?6:0);break;case r:n=(e-t)/f+2;break;case e:n=(t-r)/f+4}n/=6}return{h:n,s:a,v:s}}function h(t,r,e,n){var a=[F(Math.round(t).toString(16)),F(Math.round(r).toString(16)),F(Math.round(e).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function u(t,r,e,n){return[F(j(n)),F(Math.round(t).toString(16)),F(Math.round(r).toString(16)),F(Math.round(e).toString(16))].join("")}function l(t,r){r=0===r?0:r||10;var e=o(t).toHsl();return e.s-=r/100,e.s=R(e.s),o(e)}function c(t,r){r=0===r?0:r||10;var e=o(t).toHsl();return e.s+=r/100,e.s=R(e.s),o(e)}function g(t){return o(t).desaturate(100)}function d(t,r){r=0===r?0:r||10;var e=o(t).toHsl();return e.l+=r/100,e.l=R(e.l),o(e)}function b(t,r){r=0===r?0:r||10;var e=o(t).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(-r/100*255))),e.g=Math.max(0,Math.min(255,e.g-Math.round(-r/100*255))),e.b=Math.max(0,Math.min(255,e.b-Math.round(-r/100*255))),o(e)}function m(t,r){r=0===r?0:r||10;var e=o(t).toHsl();return e.l-=r/100,e.l=R(e.l),o(e)}function p(t,r){var e=o(t).toHsl(),n=(e.h+r)%360;return e.h=n<0?360+n:n,o(e)}function _(t){var r=o(t).toHsl();return r.h=(r.h+180)%360,o(r)}function v(t,r){if(isNaN(r)||r<=0)throw new Error("Argument to polyad must be a positive number");for(var e=o(t).toHsl(),n=[o(t)],a=360/r,i=1;i<r;i++)n.push(o({h:(e.h+i*a)%360,s:e.s,l:e.l}));return n}function y(t){var r=o(t).toHsl(),e=r.h;return[o(t),o({h:(e+72)%360,s:r.s,l:r.l}),o({h:(e+216)%360,s:r.s,l:r.l})]}function M(t,r,e){r=r||6,e=e||30;var n=o(t).toHsl(),a=360/e,i=[o(t)];for(n.h=(n.h-(a*r>>1)+720)%360;--r;)n.h=(n.h+a)%360,i.push(o(n));return i}function A(t,r){r=r||6;for(var e=o(t).toHsv(),n=e.h,a=e.s,i=e.v,s=[],f=1/r;r--;)s.push(o({h:n,s:a,v:i})),i=(i+f)%1;return s}o.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,e,n=this.toRgb();return t=n.r/255,r=n.g/255,e=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))},setAlpha:function(t){return this._a=k(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),r=Math.round(360*t.h),e=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+r+", "+e+"%, "+n+"%)":"hsva("+r+", "+e+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=s(this._r,this._g,this._b),r=Math.round(360*t.h),e=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+r+", "+e+"%, "+n+"%)":"hsla("+r+", "+e+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return h(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,r,e,n,a){var i=[F(Math.round(t).toString(16)),F(Math.round(r).toString(16)),F(Math.round(e).toString(16)),F(j(n))];if(a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*S(this._r,255))+"%",g:Math.round(100*S(this._g,255))+"%",b:Math.round(100*S(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%)":"rgba("+Math.round(100*S(this._r,255))+"%, "+Math.round(100*S(this._g,255))+"%, "+Math.round(100*S(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(w[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var r="#"+u(this._r,this._g,this._b,this._a),e=r,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=o(t);e="#"+u(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+e+")"},toString:function(t){var r=!!t;t=t||this._format;var e=!1,n=this._a<1&&this._a>=0;return r||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(e=this.toRgbString()),"prgb"===t&&(e=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(e=this.toHexString()),"hex3"===t&&(e=this.toHexString(!0)),"hex4"===t&&(e=this.toHex8String(!0)),"hex8"===t&&(e=this.toHex8String()),"name"===t&&(e=this.toName()),"hsl"===t&&(e=this.toHslString()),"hsv"===t&&(e=this.toHsvString()),e||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return o(this.toString())},_applyModification:function(t,r){var e=t.apply(null,[this].concat([].slice.call(r)));return this._r=e._r,this._g=e._g,this._b=e._b,this.setAlpha(e._a),this},lighten:function(){return this._applyModification(d,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(c,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(v,[3])},tetrad:function(){return this._applyCombination(v,[4])}},o.fromRatio=function(t,r){if("object"==n(t)){var e={};for(var a in t)t.hasOwnProperty(a)&&(e[a]="a"===a?t[a]:C(t[a]));t=e}return o(t,r)},o.equals=function(t,r){return!(!t||!r)&&o(t).toRgbString()==o(r).toRgbString()},o.random=function(){return o.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},o.mix=function(t,r,e){e=0===e?0:e||50;var n=o(t).toRgb(),a=o(r).toRgb(),i=e/100;return o({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},
// Version 1.2.2 canvas-color-tracker - https://github.com/vasturiano/canvas-color-tracker
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).ColorTracker=r()}(this,(function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e){return r&&function(t,r){for(var e=0;e<r.length;e++){var a=r[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,n(a.key),a)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof r?r:r+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}var i=/^\s+/,o=/\s+$/;function s(t,r){if(r=r||{},(t=t||"")instanceof s)return t;if(!(this instanceof s))return new s(t,r);var e=function(t){var r={r:0,g:0,b:0},e=1,n=null,s=null,f=null,h=!1,u=!1;"string"==typeof t&&(t=function(t){t=t.replace(i,"").replace(o,"").toLowerCase();var r,e=!1;if(w[t])t=w[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(r=N.rgb.exec(t))return{r:r[1],g:r[2],b:r[3]};if(r=N.rgba.exec(t))return{r:r[1],g:r[2],b:r[3],a:r[4]};if(r=N.hsl.exec(t))return{h:r[1],s:r[2],l:r[3]};if(r=N.hsla.exec(t))return{h:r[1],s:r[2],l:r[3],a:r[4]};if(r=N.hsv.exec(t))return{h:r[1],s:r[2],v:r[3]};if(r=N.hsva.exec(t))return{h:r[1],s:r[2],v:r[3],a:r[4]};if(r=N.hex8.exec(t))return{r:F(r[1]),g:F(r[2]),b:F(r[3]),a:E(r[4]),format:e?"name":"hex8"};if(r=N.hex6.exec(t))return{r:F(r[1]),g:F(r[2]),b:F(r[3]),format:e?"name":"hex"};if(r=N.hex4.exec(t))return{r:F(r[1]+""+r[1]),g:F(r[2]+""+r[2]),b:F(r[3]+""+r[3]),a:E(r[4]+""+r[4]),format:e?"name":"hex8"};if(r=N.hex3.exec(t))return{r:F(r[1]+""+r[1]),g:F(r[2]+""+r[2]),b:F(r[3]+""+r[3]),format:e?"name":"hex"};return!1}(t));"object"==a(t)&&(P(t.r)&&P(t.g)&&P(t.b)?(l=t.r,c=t.g,g=t.b,r={r:255*R(l,255),g:255*R(c,255),b:255*R(g,255)},h=!0,u="%"===String(t.r).substr(-1)?"prgb":"rgb"):P(t.h)&&P(t.s)&&P(t.v)?(n=j(t.s),s=j(t.v),r=function(t,r,e){t=6*R(t,360),r=R(r,100),e=R(e,100);var n=Math.floor(t),a=t-n,i=e*(1-r),o=e*(1-a*r),s=e*(1-(1-a)*r),f=n%6,h=[e,o,i,i,s,e][f],u=[s,e,e,o,i,i][f],l=[i,i,s,e,e,o][f];return{r:255*h,g:255*u,b:255*l}}(t.h,n,s),h=!0,u="hsv"):P(t.h)&&P(t.s)&&P(t.l)&&(n=j(t.s),f=j(t.l),r=function(t,r,e){var n,a,i;function o(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}if(t=R(t,360),r=R(r,100),e=R(e,100),0===r)n=a=i=e;else{var s=e<.5?e*(1+r):e+r-e*r,f=2*e-s;n=o(f,s,t+1/3),a=o(f,s,t),i=o(f,s,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(t.h,n,f),h=!0,u="hsl"),t.hasOwnProperty("a")&&(e=t.a));var l,c,g;return e=S(e),{ok:h,format:t.format||u,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:e}}(t);this._originalInput=t,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=r.format||e.format,this._gradientType=r.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}function f(t,r,e){t=R(t,255),r=R(r,255),e=R(e,255);var n,a,i=Math.max(t,r,e),o=Math.min(t,r,e),s=(i+o)/2;if(i==o)n=a=0;else{var f=i-o;switch(a=s>.5?f/(2-i-o):f/(i+o),i){case t:n=(r-e)/f+(r<e?6:0);break;case r:n=(e-t)/f+2;break;case e:n=(t-r)/f+4}n/=6}return{h:n,s:a,l:s}}function h(t,r,e){t=R(t,255),r=R(r,255),e=R(e,255);var n,a,i=Math.max(t,r,e),o=Math.min(t,r,e),s=i,f=i-o;if(a=0===i?0:f/i,i==o)n=0;else{switch(i){case t:n=(r-e)/f+(r<e?6:0);break;case r:n=(e-t)/f+2;break;case e:n=(t-r)/f+4}n/=6}return{h:n,s:a,v:s}}function u(t,r,e,n){var a=[C(Math.round(t).toString(16)),C(Math.round(r).toString(16)),C(Math.round(e).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function l(t,r,e,n){return[C(T(n)),C(Math.round(t).toString(16)),C(Math.round(r).toString(16)),C(Math.round(e).toString(16))].join("")}function c(t,r){r=0===r?0:r||10;var e=s(t).toHsl();return e.s-=r/100,e.s=H(e.s),s(e)}function g(t,r){r=0===r?0:r||10;var e=s(t).toHsl();return e.s+=r/100,e.s=H(e.s),s(e)}function d(t){return s(t).desaturate(100)}function b(t,r){r=0===r?0:r||10;var e=s(t).toHsl();return e.l+=r/100,e.l=H(e.l),s(e)}function m(t,r){r=0===r?0:r||10;var e=s(t).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(-r/100*255))),e.g=Math.max(0,Math.min(255,e.g-Math.round(-r/100*255))),e.b=Math.max(0,Math.min(255,e.b-Math.round(-r/100*255))),s(e)}function p(t,r){r=0===r?0:r||10;var e=s(t).toHsl();return e.l-=r/100,e.l=H(e.l),s(e)}function _(t,r){var e=s(t).toHsl(),n=(e.h+r)%360;return e.h=n<0?360+n:n,s(e)}function v(t){var r=s(t).toHsl();return r.h=(r.h+180)%360,s(r)}function y(t,r){if(isNaN(r)||r<=0)throw new Error("Argument to polyad must be a positive number");for(var e=s(t).toHsl(),n=[s(t)],a=360/r,i=1;i<r;i++)n.push(s({h:(e.h+i*a)%360,s:e.s,l:e.l}));return n}function M(t){var r=s(t).toHsl(),e=r.h;return[s(t),s({h:(e+72)%360,s:r.s,l:r.l}),s({h:(e+216)%360,s:r.s,l:r.l})]}function A(t,r,e){r=r||6,e=e||30;var n=s(t).toHsl(),a=360/e,i=[s(t)];for(n.h=(n.h-(a*r>>1)+720)%360;--r;)n.h=(n.h+a)%360,i.push(s(n));return i}function x(t,r){r=r||6;for(var e=s(t).toHsv(),n=e.h,a=e.s,i=e.v,o=[],f=1/r;r--;)o.push(s({h:n,s:a,v:i})),i=(i+f)%1;return o}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,r,e,n=this.toRgb();return t=n.r/255,r=n.g/255,e=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))},setAlpha:function(t){return this._a=S(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=h(this._r,this._g,this._b),r=Math.round(360*t.h),e=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+r+", "+e+"%, "+n+"%)":"hsva("+r+", "+e+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=f(this._r,this._g,this._b),r=Math.round(360*t.h),e=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+r+", "+e+"%, "+n+"%)":"hsla("+r+", "+e+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return u(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,r,e,n,a){var i=[C(Math.round(t).toString(16)),C(Math.round(r).toString(16)),C(Math.round(e).toString(16)),C(T(n))];if(a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*R(this._r,255))+"%",g:Math.round(100*R(this._g,255))+"%",b:Math.round(100*R(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*R(this._r,255))+"%, "+Math.round(100*R(this._g,255))+"%, "+Math.round(100*R(this._b,255))+"%)":"rgba("+Math.round(100*R(this._r,255))+"%, "+Math.round(100*R(this._g,255))+"%, "+Math.round(100*R(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var r="#"+l(this._r,this._g,this._b,this._a),e=r,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=s(t);e="#"+l(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+r+",endColorstr="+e+")"},toString:function(t){var r=!!t;t=t||this._format;var e=!1,n=this._a<1&&this._a>=0;return r||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(e=this.toRgbString()),"prgb"===t&&(e=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(e=this.toHexString()),"hex3"===t&&(e=this.toHexString(!0)),"hex4"===t&&(e=this.toHex8String(!0)),"hex8"===t&&(e=this.toHex8String()),"name"===t&&(e=this.toName()),"hsl"===t&&(e=this.toHslString()),"hsv"===t&&(e=this.toHsvString()),e||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return s(this.toString())},_applyModification:function(t,r){var e=t.apply(null,[this].concat([].slice.call(r)));return this._r=e._r,this._g=e._g,this._b=e._b,this.setAlpha(e._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(p,arguments)},desaturate:function(){return this._applyModification(c,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(A,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(y,[3])},tetrad:function(){return this._applyCombination(y,[4])}},s.fromRatio=function(t,r){if("object"==a(t)){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]="a"===n?t[n]:j(t[n]));t=e}return s(t,r)},s.equals=function(t,r){return!(!t||!r)&&s(t).toRgbString()==s(r).toRgbString()},s.random=function(){return s.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},s.mix=function(t,r,e){e=0===e?0:e||50;var n=s(t).toRgb(),a=s(r).toRgb(),i=e/100;return s({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
o.readability=function(t,r){var e=o(t),n=o(r);return(Math.max(e.getLuminance(),n.getLuminance())+.05)/(Math.min(e.getLuminance(),n.getLuminance())+.05)},o.isReadable=function(t,r,e){var n,a,i=o.readability(t,r);switch(a=!1,(n=function(t){var r,e;r=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),e=(t.size||"small").toLowerCase(),"AA"!==r&&"AAA"!==r&&(r="AA");"small"!==e&&"large"!==e&&(e="small");return{level:r,size:e}}(e)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},o.mostReadable=function(t,r,e){var n,a,i,s,f=null,h=0;a=(e=e||{}).includeFallbackColors,i=e.level,s=e.size;for(var u=0;u<r.length;u++)(n=o.readability(t,r[u]))>h&&(h=n,f=o(r[u]));return o.isReadable(t,f,{level:i,size:s})||!a?f:(e.includeFallbackColors=!1,o.mostReadable(t,["#fff","#000"],e))};var x=o.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},w=o.hexNames=function(t){var r={};for(var e in t)t.hasOwnProperty(e)&&(r[t[e]]=e);return r}(x);function k(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function S(t,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var e=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(r,Math.max(0,parseFloat(t))),e&&(t=parseInt(t*r,10)/100),Math.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function R(t){return Math.min(1,Math.max(0,t))}function H(t){return parseInt(t,16)}function F(t){return 1==t.length?"0"+t:""+t}function C(t){return t<=1&&(t=100*t+"%"),t}function j(t){return Math.round(255*parseFloat(t)).toString(16)}function T(t){return H(t)/255}var E,I,N,q=(I="[\\s|\\(]+("+(E="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",N="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",{CSS_UNIT:new RegExp(E),rgb:new RegExp("rgb"+I),rgba:new RegExp("rgba"+N),hsl:new RegExp("hsl"+I),hsla:new RegExp("hsla"+N),hsv:new RegExp("hsv"+I),hsva:new RegExp("hsva"+N),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function B(t){return!!q.CSS_UNIT.exec(t)}var O=function(t,r,e){return(t<<16)+(r<<8)+e},P=function(t,r){return 123*t%Math.pow(2,r)},L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.csBits=t,this.registry=["__reserved for background__"]}var n,a,i;return n=e,(a=[{key:"register",value:function(t){if(this.registry.length>=Math.pow(2,24-this.csBits))return null;var r,e=this.registry.length,n=P(e,this.csBits),a=(r=e+(n<<24-this.csBits),"#".concat(Math.min(r,Math.pow(2,24)).toString(16).padStart(6,"0")));return this.registry.push(t),a}},{key:"lookup",value:function(t){var e,n,a,i,s="string"==typeof t?(e=o(t).toRgb(),n=e.r,a=e.g,i=e.b,O(n,a,i)):O.apply(void 0,r(t));if(!s)return null;var f=s&Math.pow(2,24-this.csBits)-1,h=s>>24-this.csBits&Math.pow(2,this.csBits)-1;return P(f,this.csBits)!==h||f>=this.registry.length?null:this.registry[f]}}])&&t(n.prototype,a),i&&t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();return L}));
s.readability=function(t,r){var e=s(t),n=s(r);return(Math.max(e.getLuminance(),n.getLuminance())+.05)/(Math.min(e.getLuminance(),n.getLuminance())+.05)},s.isReadable=function(t,r,e){var n,a,i=s.readability(t,r);switch(a=!1,(n=function(t){var r,e;r=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),e=(t.size||"small").toLowerCase(),"AA"!==r&&"AAA"!==r&&(r="AA");"small"!==e&&"large"!==e&&(e="small");return{level:r,size:e}}(e)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},s.mostReadable=function(t,r,e){var n,a,i,o,f=null,h=0;a=(e=e||{}).includeFallbackColors,i=e.level,o=e.size;for(var u=0;u<r.length;u++)(n=s.readability(t,r[u]))>h&&(h=n,f=s(r[u]));return s.isReadable(t,f,{level:i,size:o})||!a?f:(e.includeFallbackColors=!1,s.mostReadable(t,["#fff","#000"],e))};var w=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=s.hexNames=function(t){var r={};for(var e in t)t.hasOwnProperty(e)&&(r[t[e]]=e);return r}(w);function S(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function R(t,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var e=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(r,Math.max(0,parseFloat(t))),e&&(t=parseInt(t*r,10)/100),Math.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function H(t){return Math.min(1,Math.max(0,t))}function F(t){return parseInt(t,16)}function C(t){return 1==t.length?"0"+t:""+t}function j(t){return t<=1&&(t=100*t+"%"),t}function T(t){return Math.round(255*parseFloat(t)).toString(16)}function E(t){return F(t)/255}var I,q,B,N=(q="[\\s|\\(]+("+(I="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",B="[\\s|\\(]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")[,|\\s]+("+I+")\\s*\\)?",{CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+q),rgba:new RegExp("rgba"+B),hsl:new RegExp("hsl"+q),hsla:new RegExp("hsla"+B),hsv:new RegExp("hsv"+q),hsva:new RegExp("hsva"+B),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function P(t){return!!N.CSS_UNIT.exec(t)}var O=function(t,r,e){return(t<<16)+(r<<8)+e},L=function(t,r){return 123*t%Math.pow(2,r)},z=function(){return r((function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.csBits=r,this.registry=["__reserved for background__"]}),[{key:"register",value:function(t){if(this.registry.length>=Math.pow(2,24-this.csBits))return null;var r,e=this.registry.length,n=L(e,this.csBits),a=(r=e+(n<<24-this.csBits),"#".concat(Math.min(r,Math.pow(2,24)).toString(16).padStart(6,"0")));return this.registry.push(t),a}},{key:"lookup",value:function(t){var r,n,a,i,o="string"==typeof t?(r=s(t).toRgb(),n=r.r,a=r.g,i=r.b,O(n,a,i)):O.apply(void 0,e(t));if(!o)return null;var f=o&Math.pow(2,24-this.csBits)-1,h=o>>24-this.csBits&Math.pow(2,this.csBits)-1;return L(f,this.csBits)!==h||f>=this.registry.length?null:this.registry[f]}}])}();return z}));
{
"name": "canvas-color-tracker",
"version": "1.2.1",
"version": "1.2.2",
"description": "A utility to track objects on a canvas by unique px color",

@@ -11,2 +11,3 @@ "type": "module",

"exports": {
"types": "./dist/canvas-color-tracker.d.ts",
"umd": "./dist/canvas-color-tracker.min.js",

@@ -50,12 +51,12 @@ "default": "./dist/canvas-color-tracker.mjs"

"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"rimraf": "^4.1.2",
"rollup": "^3.14.0",
"rollup-plugin-dts": "^5.1.1",
"typescript": "^4.9.5"
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"rimraf": "^6.0.1",
"rollup": "^4.18.1",
"rollup-plugin-dts": "^6.1.1",
"typescript": "^5.5.3"
},

@@ -62,0 +63,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc