-
Notifications
You must be signed in to change notification settings - Fork 40
/
matrix-element.22.min.js
2 lines (2 loc) · 28.5 KB
/
matrix-element.22.min.js
1
2
(window["matrixElement_jsonp"]=window["matrixElement_jsonp"]||[]).push([[22],{"1ab9":function(r,e,n){var t=n("4f4d"),a=n("2514"),o=Object.hasOwnProperty,l=Object.create(null);for(var i in t)o.call(t,i)&&(l[t[i]]=i);var u=r.exports={to:{},get:{}};function s(r,e,n){return Math.min(Math.max(e,r),n)}function h(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(r){var e,n,t=r.substring(0,3).toLowerCase();switch(t){case"hsl":e=u.get.hsl(r),n="hsl";break;case"hwb":e=u.get.hwb(r),n="hwb";break;default:e=u.get.rgb(r),n="rgb";break}return e?{model:n,value:e}:null},u.get.rgb=function(r){if(!r)return null;var e,n,a,l=/^#([a-f0-9]{3,4})$/i,i=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,u=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,h=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,c=/^(\w+)$/,f=[0,0,0,1];if(e=r.match(i)){for(a=e[2],e=e[1],n=0;n<3;n++){var d=2*n;f[n]=parseInt(e.slice(d,d+2),16)}a&&(f[3]=parseInt(a,16)/255)}else if(e=r.match(l)){for(e=e[1],a=e[3],n=0;n<3;n++)f[n]=parseInt(e[n]+e[n],16);a&&(f[3]=parseInt(a+a,16)/255)}else if(e=r.match(u)){for(n=0;n<3;n++)f[n]=parseInt(e[n+1],0);e[4]&&(e[5]?f[3]=.01*parseFloat(e[4]):f[3]=parseFloat(e[4]))}else{if(!(e=r.match(h)))return(e=r.match(c))?"transparent"===e[1]?[0,0,0,0]:o.call(t,e[1])?(f=t[e[1]],f[3]=1,f):null:null;for(n=0;n<3;n++)f[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?f[3]=.01*parseFloat(e[4]):f[3]=parseFloat(e[4]))}for(n=0;n<3;n++)f[n]=s(f[n],0,255);return f[3]=s(f[3],0,1),f},u.get.hsl=function(r){if(!r)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=r.match(e);if(n){var t=parseFloat(n[4]),a=(parseFloat(n[1])%360+360)%360,o=s(parseFloat(n[2]),0,100),l=s(parseFloat(n[3]),0,100),i=s(isNaN(t)?1:t,0,1);return[a,o,l,i]}return null},u.get.hwb=function(r){if(!r)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=r.match(e);if(n){var t=parseFloat(n[4]),a=(parseFloat(n[1])%360+360)%360,o=s(parseFloat(n[2]),0,100),l=s(parseFloat(n[3]),0,100),i=s(isNaN(t)?1:t,0,1);return[a,o,l,i]}return null},u.to.hex=function(){var r=a(arguments);return"#"+h(r[0])+h(r[1])+h(r[2])+(r[3]<1?h(Math.round(255*r[3])):"")},u.to.rgb=function(){var r=a(arguments);return r.length<4||1===r[3]?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"},u.to.rgb.percent=function(){var r=a(arguments),e=Math.round(r[0]/255*100),n=Math.round(r[1]/255*100),t=Math.round(r[2]/255*100);return r.length<4||1===r[3]?"rgb("+e+"%, "+n+"%, "+t+"%)":"rgba("+e+"%, "+n+"%, "+t+"%, "+r[3]+")"},u.to.hsl=function(){var r=a(arguments);return r.length<4||1===r[3]?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"},u.to.hwb=function(){var r=a(arguments),e="";return r.length>=4&&1!==r[3]&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"},u.to.keyword=function(r){return l[r.slice(0,3)]}},2514:function(r,e,n){"use strict";var t=n("b8fa"),a=Array.prototype.concat,o=Array.prototype.slice,l=r.exports=function(r){for(var e=[],n=0,l=r.length;n<l;n++){var i=r[n];t(i)?e=a.call(e,o.call(i)):e.push(i)}return e};l.wrap=function(r){return function(){return r(l(arguments))}}},"4f4d":function(r,e,n){"use strict";r.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},"5b1b":function(r,e){r.exports=function(r){var e={};function n(t){if(e[t])return e[t].exports;var a=e[t]={i:t,l:!1,exports:{}};return r[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=r,n.c=e,n.d=function(r,e,t){n.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:t})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,e){if(1&e&&(r=n(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var a in r)n.d(t,a,function(e){return r[e]}.bind(null,a));return t},n.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(e,"a",e),e},n.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},n.p="",n(n.s=0)}([function(r,e,n){"use strict";n.r(e),n.d(e,"validateHTMLColorName",(function(){return l})),n.d(e,"validateHTMLColorSpecialName",(function(){return i})),n.d(e,"validateHTMLColorHex",(function(){return u})),n.d(e,"validateHTMLColorRgb",(function(){return b})),n.d(e,"validateHTMLColorHsl",(function(){return p})),n.d(e,"validateHTMLColorHwb",(function(){return v})),n.d(e,"validateHTMLColorLab",(function(){return m})),n.d(e,"validateHTMLColorLch",(function(){return y})),n.d(e,"validateHTMLColor",(function(){return w}));const t=r=>r&&"string"==typeof r,a=["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenrod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","Goldenrod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenrodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquamarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenrod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],o=["currentColor","inherit","transparent"],l=r=>{let e=!1;return t(r)&&a.map(n=>(r.toLowerCase()===n.toLowerCase()&&(e=!0),null)),e},i=r=>{let e=!1;return t(r)&&o.map(n=>(r.toLowerCase()===n.toLowerCase()&&(e=!0),null)),e},u=r=>{if(t(r)){const e=/^#([\da-f]{3}){1,2}$|^#([\da-f]{4}){1,2}$/i;return r&&e.test(r)}return!1},s="(([\\d]{0,5})((\\.([\\d]{1,5}))?))",h=`(${s}%)`,c="(([0-9]|[1-9][0-9]|100)%)",f=`(${c}|(0?((\\.([\\d]{1,5}))?))|1)`,d=`([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?)([\\s]{1,5})(((${c}))|(0?((\\.([\\d]{1,5}))?))|1))?([\\s]{0,5})\\)`,g="(-?(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360)(deg)?)",b=r=>{if(t(r)){const e="([\\s]{0,5})([\\d]{1,5})%?([\\s]{0,5}),?",n="((([\\s]{0,5}),?([\\s]{0,5}))|(([\\s]{1,5})))",t=new RegExp(`^(rgb)a?\\(${e}${n}${e}${n}${e}${n}((\\/?([\\s]{0,5})(0?\\.?([\\d]{1,5})%?([\\s]{0,5}))?|1|0))?\\)$`);return r&&t.test(r)}return!1},p=r=>{if(t(r)){const e=new RegExp(`^(hsl)a?\\((([\\s]{0,5})(${g}|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-9][0-9]|400)grad)|((([0-5])?\\.([\\d]{1,5})|6\\.([0-9]|1[0-9]|2[0-8])|[0-6])rad)|((0?((\\.([\\d]{1,5}))?)|1)turn))((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${c})((([\\s]{0,5}),([\\s]{0,5}))|(([\\s]{1,5}))))(([\\s]{0,5})(0|${c})([\\s]{0,5})\\)?)(([\\s]{0,5})(\\/?|,?)([\\s]{0,5})(((${c}))|(0?((\\.([\\d]{1,5}))?))|1))?\\)$`);return r&&e.test(r)}return!1},v=r=>{if(t(r)){const e=new RegExp(`^(hwb\\(([\\s]{0,5})${g}([\\s]{1,5}))((0|${c})([\\s]{1,5}))((0|${c})${d}$`);return r&&e.test(r)}return!1},m=r=>{if(t(r)){const e="(-?(([0-9]|[1-9][0-9]|1[0-5][0-9])((\\.([\\d]{1,5}))?)?|160))",n=new RegExp(`^(lab\\(([\\s]{0,5})${h}([\\s]{1,5})${e}([\\s]{1,5})${e}${d}$`);return r&&n.test(r)}return!1},y=r=>{if(t(r)){const e="((([0-9]|[1-9][0-9])?((\\.([\\d]{1,5}))?)|100)(%)?)",n=""+s,t=`((${g})|(0|${f})|(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-9][0-9]|3[0-5][0-9])((\\.([\\d]{1,5}))?)|360))`,a=`(\\/([\\s]{0,5})${f})`,o=new RegExp(`^lch\\((([\\s]{0,5})${e}([\\s]{1,5})${n}([\\s]{1,5})${t}([\\s]{0,5})(${a})?)\\)$`);return r&&o.test(r)}return!1},w=r=>!!(r&&u(r)||b(r)||p(r)||v(r)||m(r)||y(r));e.default=r=>!!(r&&u(r)||l(r)||i(r)||b(r)||p(r)||v(r)||m(r)||y(r))}])},6929:function(r,e,n){"use strict";var t=n("1ab9"),a=n("bb15"),o=[].slice,l=["keyword","gray","hex"],i={};Object.keys(a).forEach((function(r){i[o.call(a[r].labels).sort().join("")]=r}));var u={};function s(r,e){if(!(this instanceof s))return new s(r,e);if(e&&e in l&&(e=null),e&&!(e in a))throw new Error("Unknown model: "+e);var n,h;if(null==r)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof s)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if("string"===typeof r){var c=t.get(r);if(null===c)throw new Error("Unable to parse color from string: "+r);this.model=c.model,h=a[this.model].channels,this.color=c.value.slice(0,h),this.valpha="number"===typeof c.value[h]?c.value[h]:1}else if(r.length){this.model=e||"rgb",h=a[this.model].channels;var f=o.call(r,0,h);this.color=b(f,h),this.valpha="number"===typeof r[h]?r[h]:1}else if("number"===typeof r)r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,255&r],this.valpha=1;else{this.valpha=1;var d=Object.keys(r);"alpha"in r&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"===typeof r.alpha?r.alpha:0);var g=d.sort().join("");if(!(g in i))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=i[g];var p=a[this.model].labels,v=[];for(n=0;n<p.length;n++)v.push(r[p[n]]);this.color=b(v)}if(u[this.model])for(h=a[this.model].channels,n=0;n<h;n++){var m=u[this.model][n];m&&(this.color[n]=m(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function h(r,e){return Number(r.toFixed(e))}function c(r){return function(e){return h(e,r)}}function f(r,e,n){return r=Array.isArray(r)?r:[r],r.forEach((function(r){(u[r]||(u[r]=[]))[e]=n})),r=r[0],function(t){var a;return arguments.length?(n&&(t=n(t)),a=this[r](),a.color[e]=t,a):(a=this[r]().color[e],n&&(a=n(a)),a)}}function d(r){return function(e){return Math.max(0,Math.min(r,e))}}function g(r){return Array.isArray(r)?r:[r]}function b(r,e){for(var n=0;n<e;n++)"number"!==typeof r[n]&&(r[n]=0);return r}s.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var e=this.model in t.to?this:this.rgb();e=e.round("number"===typeof r?r:1);var n=1===e.valpha?e.color:e.color.concat(this.valpha);return t.to[e.model](n)},percentString:function(r){var e=this.rgb().round("number"===typeof r?r:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return t.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},e=a[this.model].channels,n=a[this.model].labels,t=0;t<e;t++)r[n[t]]=this.color[t];return 1!==this.valpha&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,1!==this.valpha&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,1!==this.valpha&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new s(this.color.map(c(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new s(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:f("rgb",0,d(255)),green:f("rgb",1,d(255)),blue:f("rgb",2,d(255)),hue:f(["hsl","hsv","hsl","hwb","hcg"],0,(function(r){return(r%360+360)%360})),saturationl:f("hsl",1,d(100)),lightness:f("hsl",2,d(100)),saturationv:f("hsv",1,d(100)),value:f("hsv",2,d(100)),chroma:f("hcg",1,d(100)),gray:f("hcg",2,d(100)),white:f("hwb",1,d(100)),wblack:f("hwb",2,d(100)),cyan:f("cmyk",0,d(100)),magenta:f("cmyk",1,d(100)),yellow:f("cmyk",2,d(100)),black:f("cmyk",3,d(100)),x:f("xyz",0,d(100)),y:f("xyz",1,d(100)),z:f("xyz",2,d(100)),l:f("lab",0,d(100)),a:f("lab",1),b:f("lab",2),keyword:function(r){return arguments.length?new s(r):a[this.model].keyword(this.color)},hex:function(r){return arguments.length?new s(r):t.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(255&r[0])<<16|(255&r[1])<<8|255&r[2]},luminosity:function(){for(var r=this.rgb().color,e=[],n=0;n<r.length;n++){var t=r[n]/255;e[n]=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(r){var e=this.luminosity(),n=r.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(r){var e=this.contrast(r);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,e=(299*r[0]+587*r[1]+114*r[2])/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten:function(r){var e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken:function(r){var e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate:function(r){var e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate:function(r){var e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten:function(r){var e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken:function(r){var e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale:function(){var r=this.rgb().color,e=.3*r[0]+.59*r[1]+.11*r[2];return s.rgb(e,e,e)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var e=this.hsl(),n=e.color[0];return n=(n+r)%360,n=n<0?360+n:n,e.color[0]=n,e},mix:function(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var n=r.rgb(),t=this.rgb(),a=void 0===e?.5:e,o=2*a-1,l=n.alpha()-t.alpha(),i=((o*l===-1?o:(o+l)/(1+o*l))+1)/2,u=1-i;return s.rgb(i*n.red()+u*t.red(),i*n.green()+u*t.green(),i*n.blue()+u*t.blue(),n.alpha()*a+t.alpha()*(1-a))}},Object.keys(a).forEach((function(r){if(-1===l.indexOf(r)){var e=a[r].channels;s.prototype[r]=function(){if(this.model===r)return new s(this);if(arguments.length)return new s(arguments,r);var n="number"===typeof arguments[e]?e:this.valpha;return new s(g(a[this.model][r].raw(this.color)).concat(n),r)},s[r]=function(n){return"number"===typeof n&&(n=b(o.call(arguments),e)),new s(n,r)}}})),r.exports=s},a279:function(r,e,n){var t=n("b753");function a(){for(var r={},e=Object.keys(t),n=e.length,a=0;a<n;a++)r[e[a]]={distance:-1,parent:null};return r}function o(r){var e=a(),n=[r];e[r].distance=0;while(n.length)for(var o=n.pop(),l=Object.keys(t[o]),i=l.length,u=0;u<i;u++){var s=l[u],h=e[s];-1===h.distance&&(h.distance=e[o].distance+1,h.parent=o,n.unshift(s))}return e}function l(r,e){return function(n){return e(r(n))}}function i(r,e){var n=[e[r].parent,r],a=t[e[r].parent][r],o=e[r].parent;while(e[o].parent)n.unshift(e[o].parent),a=l(t[e[o].parent][o],a),o=e[o].parent;return a.conversion=n,a}r.exports=function(r){for(var e=o(r),n={},t=Object.keys(e),a=t.length,l=0;l<a;l++){var u=t[l],s=e[u];null!==s.parent&&(n[u]=i(u,e))}return n}},b753:function(r,e,n){var t=n("4f4d"),a={};for(var o in t)t.hasOwnProperty(o)&&(a[t[o]]=o);var l=r.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in l)if(l.hasOwnProperty(i)){if(!("channels"in l[i]))throw new Error("missing channels property: "+i);if(!("labels"in l[i]))throw new Error("missing channel labels property: "+i);if(l[i].labels.length!==l[i].channels)throw new Error("channel and label counts mismatch: "+i);var u=l[i].channels,s=l[i].labels;delete l[i].channels,delete l[i].labels,Object.defineProperty(l[i],"channels",{value:u}),Object.defineProperty(l[i],"labels",{value:s})}function h(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}l.rgb.hsl=function(r){var e,n,t,a=r[0]/255,o=r[1]/255,l=r[2]/255,i=Math.min(a,o,l),u=Math.max(a,o,l),s=u-i;return u===i?e=0:a===u?e=(o-l)/s:o===u?e=2+(l-a)/s:l===u&&(e=4+(a-o)/s),e=Math.min(60*e,360),e<0&&(e+=360),t=(i+u)/2,n=u===i?0:t<=.5?s/(u+i):s/(2-u-i),[e,100*n,100*t]},l.rgb.hsv=function(r){var e,n,t,a,o,l=r[0]/255,i=r[1]/255,u=r[2]/255,s=Math.max(l,i,u),h=s-Math.min(l,i,u),c=function(r){return(s-r)/6/h+.5};return 0===h?a=o=0:(o=h/s,e=c(l),n=c(i),t=c(u),l===s?a=t-n:i===s?a=1/3+e-t:u===s&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*o,100*s]},l.rgb.hwb=function(r){var e=r[0],n=r[1],t=r[2],a=l.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(n,t));return t=1-1/255*Math.max(e,Math.max(n,t)),[a,100*o,100*t]},l.rgb.cmyk=function(r){var e,n,t,a,o=r[0]/255,l=r[1]/255,i=r[2]/255;return a=Math.min(1-o,1-l,1-i),e=(1-o-a)/(1-a)||0,n=(1-l-a)/(1-a)||0,t=(1-i-a)/(1-a)||0,[100*e,100*n,100*t,100*a]},l.rgb.keyword=function(r){var e=a[r];if(e)return e;var n,o=1/0;for(var l in t)if(t.hasOwnProperty(l)){var i=t[l],u=h(r,i);u<o&&(o=u,n=l)}return n},l.keyword.rgb=function(r){return t[r]},l.rgb.xyz=function(r){var e=r[0]/255,n=r[1]/255,t=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;var a=.4124*e+.3576*n+.1805*t,o=.2126*e+.7152*n+.0722*t,l=.0193*e+.1192*n+.9505*t;return[100*a,100*o,100*l]},l.rgb.lab=function(r){var e,n,t,a=l.rgb.xyz(r),o=a[0],i=a[1],u=a[2];return o/=95.047,i/=100,u/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,u=u>.008856?Math.pow(u,1/3):7.787*u+16/116,e=116*i-16,n=500*(o-i),t=200*(i-u),[e,n,t]},l.hsl.rgb=function(r){var e,n,t,a,o,l=r[0]/360,i=r[1]/100,u=r[2]/100;if(0===i)return o=255*u,[o,o,o];n=u<.5?u*(1+i):u+i-u*i,e=2*u-n,a=[0,0,0];for(var s=0;s<3;s++)t=l+1/3*-(s-1),t<0&&t++,t>1&&t--,o=6*t<1?e+6*(n-e)*t:2*t<1?n:3*t<2?e+(n-e)*(2/3-t)*6:e,a[s]=255*o;return a},l.hsl.hsv=function(r){var e,n,t=r[0],a=r[1]/100,o=r[2]/100,l=a,i=Math.max(o,.01);return o*=2,a*=o<=1?o:2-o,l*=i<=1?i:2-i,n=(o+a)/2,e=0===o?2*l/(i+l):2*a/(o+a),[t,100*e,100*n]},l.hsv.rgb=function(r){var e=r[0]/60,n=r[1]/100,t=r[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),l=255*t*(1-n),i=255*t*(1-n*o),u=255*t*(1-n*(1-o));switch(t*=255,a){case 0:return[t,u,l];case 1:return[i,t,l];case 2:return[l,t,u];case 3:return[l,i,t];case 4:return[u,l,t];case 5:return[t,l,i]}},l.hsv.hsl=function(r){var e,n,t,a=r[0],o=r[1]/100,l=r[2]/100,i=Math.max(l,.01);return t=(2-o)*l,e=(2-o)*i,n=o*i,n/=e<=1?e:2-e,n=n||0,t/=2,[a,100*n,100*t]},l.hwb.rgb=function(r){var e,n,t,a,o,l,i,u=r[0]/360,s=r[1]/100,h=r[2]/100,c=s+h;switch(c>1&&(s/=c,h/=c),e=Math.floor(6*u),n=1-h,t=6*u-e,0!==(1&e)&&(t=1-t),a=s+t*(n-s),e){default:case 6:case 0:o=n,l=a,i=s;break;case 1:o=a,l=n,i=s;break;case 2:o=s,l=n,i=a;break;case 3:o=s,l=a,i=n;break;case 4:o=a,l=s,i=n;break;case 5:o=n,l=s,i=a;break}return[255*o,255*l,255*i]},l.cmyk.rgb=function(r){var e,n,t,a=r[0]/100,o=r[1]/100,l=r[2]/100,i=r[3]/100;return e=1-Math.min(1,a*(1-i)+i),n=1-Math.min(1,o*(1-i)+i),t=1-Math.min(1,l*(1-i)+i),[255*e,255*n,255*t]},l.xyz.rgb=function(r){var e,n,t,a=r[0]/100,o=r[1]/100,l=r[2]/100;return e=3.2406*a+-1.5372*o+-.4986*l,n=-.9689*a+1.8758*o+.0415*l,t=.0557*a+-.204*o+1.057*l,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),t=Math.min(Math.max(0,t),1),[255*e,255*n,255*t]},l.xyz.lab=function(r){var e,n,t,a=r[0],o=r[1],l=r[2];return a/=95.047,o/=100,l/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*o-16,n=500*(a-o),t=200*(o-l),[e,n,t]},l.lab.xyz=function(r){var e,n,t,a=r[0],o=r[1],l=r[2];n=(a+16)/116,e=o/500+n,t=n-l/200;var i=Math.pow(n,3),u=Math.pow(e,3),s=Math.pow(t,3);return n=i>.008856?i:(n-16/116)/7.787,e=u>.008856?u:(e-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,e*=95.047,n*=100,t*=108.883,[e,n,t]},l.lab.lch=function(r){var e,n,t,a=r[0],o=r[1],l=r[2];return e=Math.atan2(l,o),n=360*e/2/Math.PI,n<0&&(n+=360),t=Math.sqrt(o*o+l*l),[a,t,n]},l.lch.lab=function(r){var e,n,t,a=r[0],o=r[1],l=r[2];return t=l/360*2*Math.PI,e=o*Math.cos(t),n=o*Math.sin(t),[a,e,n]},l.rgb.ansi16=function(r){var e=r[0],n=r[1],t=r[2],a=1 in arguments?arguments[1]:l.rgb.hsv(r)[2];if(a=Math.round(a/50),0===a)return 30;var o=30+(Math.round(t/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===a&&(o+=60),o},l.hsv.ansi16=function(r){return l.rgb.ansi16(l.hsv.rgb(r),r[2])},l.rgb.ansi256=function(r){var e=r[0],n=r[1],t=r[2];if(e===n&&n===t)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var a=16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(t/255*5);return a},l.ansi16.rgb=function(r){var e=r%10;if(0===e||7===e)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var n=.5*(1+~~(r>50)),t=(1&e)*n*255,a=(e>>1&1)*n*255,o=(e>>2&1)*n*255;return[t,a,o]},l.ansi256.rgb=function(r){if(r>=232){var e=10*(r-232)+8;return[e,e,e]}var n;r-=16;var t=Math.floor(r/36)/5*255,a=Math.floor((n=r%36)/6)/5*255,o=n%6/5*255;return[t,a,o]},l.rgb.hex=function(r){var e=((255&Math.round(r[0]))<<16)+((255&Math.round(r[1]))<<8)+(255&Math.round(r[2])),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n},l.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(r){return r+r})).join(""));var t=parseInt(n,16),a=t>>16&255,o=t>>8&255,l=255&t;return[a,o,l]},l.rgb.hcg=function(r){var e,n,t=r[0]/255,a=r[1]/255,o=r[2]/255,l=Math.max(Math.max(t,a),o),i=Math.min(Math.min(t,a),o),u=l-i;return e=u<1?i/(1-u):0,n=u<=0?0:l===t?(a-o)/u%6:l===a?2+(o-t)/u:4+(t-a)/u+4,n/=6,n%=1,[360*n,100*u,100*e]},l.hsl.hcg=function(r){var e=r[1]/100,n=r[2]/100,t=1,a=0;return t=n<.5?2*e*n:2*e*(1-n),t<1&&(a=(n-.5*t)/(1-t)),[r[0],100*t,100*a]},l.hsv.hcg=function(r){var e=r[1]/100,n=r[2]/100,t=e*n,a=0;return t<1&&(a=(n-t)/(1-t)),[r[0],100*t,100*a]},l.hcg.rgb=function(r){var e=r[0]/360,n=r[1]/100,t=r[2]/100;if(0===n)return[255*t,255*t,255*t];var a=[0,0,0],o=e%1*6,l=o%1,i=1-l,u=0;switch(Math.floor(o)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=i,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=i,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=i}return u=(1-n)*t,[255*(n*a[0]+u),255*(n*a[1]+u),255*(n*a[2]+u)]},l.hcg.hsv=function(r){var e=r[1]/100,n=r[2]/100,t=e+n*(1-e),a=0;return t>0&&(a=e/t),[r[0],100*a,100*t]},l.hcg.hsl=function(r){var e=r[1]/100,n=r[2]/100,t=n*(1-e)+.5*e,a=0;return t>0&&t<.5?a=e/(2*t):t>=.5&&t<1&&(a=e/(2*(1-t))),[r[0],100*a,100*t]},l.hcg.hwb=function(r){var e=r[1]/100,n=r[2]/100,t=e+n*(1-e);return[r[0],100*(t-e),100*(1-t)]},l.hwb.hcg=function(r){var e=r[1]/100,n=r[2]/100,t=1-n,a=t-e,o=0;return a<1&&(o=(t-a)/(1-a)),[r[0],100*a,100*o]},l.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]},l.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]},l.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]},l.gray.hsl=l.gray.hsv=function(r){return[0,0,r[0]]},l.gray.hwb=function(r){return[0,100,r[0]]},l.gray.cmyk=function(r){return[0,0,0,r[0]]},l.gray.lab=function(r){return[r[0],0,0]},l.gray.hex=function(r){var e=255&Math.round(r[0]/100*255),n=(e<<16)+(e<<8)+e,t=n.toString(16).toUpperCase();return"000000".substring(t.length)+t},l.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}},b8fa:function(r,e){r.exports=function(r){return!(!r||"string"===typeof r)&&(r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&"String"!==r.constructor.name))}},bb15:function(r,e,n){var t=n("b753"),a=n("a279"),o={},l=Object.keys(t);function i(r){var e=function(e){return void 0===e||null===e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),r(e))};return"conversion"in r&&(e.conversion=r.conversion),e}function u(r){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=r(e);if("object"===typeof n)for(var t=n.length,a=0;a<t;a++)n[a]=Math.round(n[a]);return n};return"conversion"in r&&(e.conversion=r.conversion),e}l.forEach((function(r){o[r]={},Object.defineProperty(o[r],"channels",{value:t[r].channels}),Object.defineProperty(o[r],"labels",{value:t[r].labels});var e=a(r),n=Object.keys(e);n.forEach((function(n){var t=e[n];o[r][n]=u(t),o[r][n].raw=i(t)}))})),r.exports=o}}]);
//# sourceMappingURL=matrix-element.22.min.js.map