Socket
Socket
Sign inDemoInstall

culori

Package Overview
Dependencies
Maintainers
3
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

culori - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

2

build/culori.umd.js

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

!function(a,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((a=a||self).culori={})}(this,(function(a){"use strict";function r(a,r){if("number"==typeof a)return 3===r?{mode:"rgb",r:(a>>8&15|a>>4&240)/255,g:(a>>4&15|240&a)/255,b:(15&a|a<<4&240)/255}:4===r?{mode:"rgb",r:(a>>12&15|a>>8&240)/255,g:(a>>8&15|a>>4&240)/255,b:(a>>4&15|240&a)/255,alpha:(15&a|a<<4&240)/255}:6===r?{mode:"rgb",r:(a>>16&255)/255,g:(a>>8&255)/255,b:(255&a)/255}:8===r?{mode:"rgb",r:(a>>24&255)/255,g:(a>>16&255)/255,b:(a>>8&255)/255,alpha:(255&a)/255}:void 0}var t={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var n=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=n+"%",o=n+"%?",i="(?:"+n+"%|"+n+")",h="(?:"+n+"(deg|grad|rad|turn)|"+n+")",u="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+n+u+n+u+n+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),s=new RegExp("^rgba?\\(\\s*"+e+u+e+u+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),d=new RegExp("^rgba?\\(\\s*"+n+l+n+l+n+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+h+u+e+u+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),f=new RegExp("^hsla?\\(\\s*"+h+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+h+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+o+l+n+l+n+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+o+l+n+l+h+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$");function w(a){return a}function y(a,r){return void 0===a&&(a=w),void 0===r&&(r=1),function(t){var n=function(a){for(var r=[],t=0;t<a.length-1;t++){var n=a[t],e=a[t+1];void 0===n&&void 0===e?r.push(void 0):void 0!==n&&void 0!==e?r.push([n,e]):r.push(void 0!==n?[n,n]:[e,e])}return r}((a||w)(t));return function(a){var t=(a=Math.pow(a,r))*n.length,e=1===a?n.length-1:Math.floor(t),o=n[e];return void 0===o?void 0:o[0]+(t-e)*(o[1]-o[0])}}}function k(a){return a.map((function(a,r,t){return void 0===a&&void 0!==t[r+1]?1:a}))}var x={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(a){var t;return(t=a.match(b))?r(parseInt(t[1],16),t[1].length):void 0},function(a){var r,t;if(r=a.match(c)||a.match(d))t={mode:"rgb",r:r[1]/255,g:r[2]/255,b:r[3]/255};else{if(!(r=a.match(s)||a.match(p)))return;t={mode:"rgb",r:r[1]/100,g:r[2]/100,b:r[3]/100}}return void 0!==r[4]?t.alpha=r[4]/100:void 0!==r[5]&&(t.alpha=+r[5]),t},function(a){return"string"==typeof a&&r(t[a.toLowerCase()],6)||void 0},function(a){return"transparent"===a?r(0,8):void 0}],interpolate:{r:y(),g:y(),b:y(),alpha:y(k)}},q=function(a){return a<.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)};function P(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o={mode:"lrgb",r:q(r),g:q(t),b:q(n)};return void 0!==e&&(o.alpha=e),o}var I=function(a){return a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a};function E(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o={mode:"rgb",r:I(r),g:I(t),b:I(n)};return void 0!==e&&(o.alpha=e),o}var R={mode:"lrgb",output:{rgb:E},input:{rgb:P},channels:["r","g","b","alpha"],interpolate:{r:y(),g:y(),b:y(),alpha:y(k)}};function j(a){return(a%=360)<0?a+360:a}var $=function(a,r){switch(r){case"deg":return+a;case"rad":return a/Math.PI*180;case"grad":return a/10*9;case"turn":return 360*a}};function A(a){for(var r=[],t=0;t<a.length;t++)if(void 0!==a[t]){var n=j(a[t]),e=void 0;0!==t&&void 0!==(e=r[r.length-1])?r.push(Math.abs(n-e)>180?n-360*Math.sign(n-e):n):r.push(n)}else r.push(void 0);return r}var C={mode:"hsl",output:{rgb:function(a){var r=a.h,t=a.s,n=a.l,e=a.alpha;r=j(r);var o,i=n+t*(n<.5?n:1-n),h=i-2*(i-n)*Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:i,g:h,b:2*n-i};break;case 1:o={r:h,g:i,b:2*n-i};break;case 2:o={r:2*n-i,g:i,b:h};break;case 3:o={r:2*n-i,g:h,b:i};break;case 4:o={r:h,g:2*n-i,b:i};break;case 5:o={r:i,g:2*n-i,b:h};break;default:o={r:2*n-i,g:2*n-i,b:2*n-i}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(v)||a.match(f);if(r){var t={mode:"hsl",h:void 0===r[3]?$(r[1],r[2]):+r[3],s:Math.min(Math.max(0,r[4]/100),1),l:Math.min(Math.max(0,r[5]/100),1)};return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=r[7]/255),t}}}],interpolate:{h:y(A),s:y(),l:y(),alpha:y(k)}};function O(a){var r=a.h,t=a.s,n=a.v,e=a.alpha;r=j(r);var o,i=Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:n,g:n*(1-t*i),b:n*(1-t)};break;case 1:o={r:n*(1-t*i),g:n,b:n*(1-t)};break;case 2:o={r:n*(1-t),g:n,b:n*(1-t*i)};break;case 3:o={r:n*(1-t),g:n*(1-t*i),b:n};break;case 4:o={r:n*(1-t*i),g:n*(1-t),b:n};break;case 5:o={r:n,g:n*(1-t),b:n*(1-t*i)};break;default:o={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}function S(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}var z={mode:"hsv",output:{rgb:O},input:{rgb:S},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:y(A),s:y(),v:y(),alpha:y(k)}};var N={mode:"hsi",output:{rgb:function(a){var r=a.h,t=a.s,n=a.i,e=a.alpha;r=j(r);var o,i=Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:n*(1+t*(3/(2-i)-1)),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1-t)};break;case 1:o={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1+t*(3/(2-i)-1)),b:n*(1-t)};break;case 2:o={r:n*(1-t),g:n*(1+t*(3/(2-i)-1)),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;case 3:o={r:n*(1-t),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1+t*(3/(2-i)-1))};break;case 4:o={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3/(2-i)-1))};break;case 5:o={r:n*(1+t*(3/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;default:o={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsi",s:r+t+n===0?0:1-3*i/(r+t+n),i:(r+t+n)/3};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:y(A),s:y(),i:y(),alpha:y(k)}};var D={mode:"hwb",output:{rgb:function(a){var r=a.h,t=a.w,n=a.b;if(t+n>1){var e=t+n;t/=e,n/=e}return O({h:r,s:1===n?1:1-t/(1-n),v:1-n,alpha:a.alpha})}},input:{rgb:function(a){var r=S(a);if(void 0!==r){var t={mode:"hwb",w:(1-r.s)*r.v,b:1-r.v};return void 0!==r.h&&(t.h=r.h),void 0!==r.alpha&&(t.alpha=r.alpha),t}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(g);if(r){var t={mode:"hwb",h:void 0===r[3]?$(r[1],r[2]):+r[3],w:r[4]/100,b:r[5]/100};if(t.w+t.b>1){var n=t.w+t.b;t.w/=n,t.b/=n}return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=r[7]/255),t}}}],interpolate:{h:y(A),w:y(),b:y(),alpha:y(k)}},L=Math.pow(29,3)/Math.pow(3,3),H=Math.pow(6,3)/Math.pow(29,3),_=function(a){return Math.pow(a,3)>H?Math.pow(a,3):(116*a-16)/L};function B(a){var r,t,n,e,o,i=function(a){var r=a.x,t=a.y,n=a.z;return E({r:3.1338561*r-1.6168667*t-.4906146*n,g:-.9787684*r+1.9161415*t+.033454*n,b:.0719453*r-.2289914*t+1.4052427*n})}((t=(r=a).l,n=r.a,o=(e=(t+16)/116)-r.b/200,{x:.96422*_(n/500+e),y:1*_(e),z:.82521*_(o)}));return i.mode="rgb",void 0!==a.alpha&&(i.alpha=a.alpha),i}var F=function(a){return a>H?Math.cbrt(a):(L*a+16)/116};function K(a){var r=function(a){var r=a.x,t=a.y,n=a.z,e=F(r/.96422),o=F(t/1);return{mode:"lab",l:116*o-16,a:500*(e-o),b:200*(o-F(n/.82521))}}(function(a){var r=P(a),t=r.r,n=r.g,e=r.b;return{x:.4360747*t+.3850649*n+.1430804*e,y:.2225045*t+.7168786*n+.0606169*e,z:.0139322*t+.0971045*n+.7141733*e}}(a));return a.r===a.b===a.g&&(r.a=r.b=0),void 0!==a.alpha&&(r.alpha=a.alpha),r}var T={mode:"lab",output:{rgb:B},input:{rgb:K},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.167,93.408],b:[-111.859,93.246]},parsers:[function(a){if("string"==typeof a){var r=a.match(M);if(r){var t={mode:"lab",l:+r[1],a:+r[2],b:+r[3]};return void 0!==r[4]?t.alpha=r[4]/100:void 0!==r[5]&&(t.alpha=+r[5]),t}}}],interpolate:{l:y(),a:y(),b:y(),alpha:y(k)}};function G(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=Math.sqrt(t*t+n*n),i={mode:"lch",l:r,c:o};return o&&(i.h=j(180*Math.atan2(n,t)/Math.PI)),void 0!==e&&(i.alpha=e),i}function J(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"lab",l:r,a:0===t?0:t*Math.cos(n/180*Math.PI),b:0===t?0:t*Math.sin(n/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}var Q={mode:"lch",output:{lab:J,rgb:function(a){return B(J(a))}},input:{rgb:function(a){return G(K(a))},lch:G},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(m);if(r){var t={mode:"lch",l:+r[1],c:Math.max(0,+r[2]),h:void 0===r[5]?$(r[3],r[4]):+r[5]};return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=+r[7]),t}}}],interpolate:{h:y(A),c:y(),l:y(),alpha:y(k)}},U=[-.14861,1.78277,-.29227,-.90649,1.97294,0],V=Math.PI/180,W=180/Math.PI,X=U[3]*U[4],Y=U[1]*U[4],Z=U[1]*U[2]-U[0]*U[3];var aa={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=(Z*n+r*X-t*Y)/(Z+X-Y),i=n-o,h=(U[4]*(t-o)-U[2]*i)/U[3],u={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+h*h)/(U[4]*o*(1-o))};return u.s&&(u.h=Math.atan2(h,i)*W-120),void 0!==e&&(u.alpha=e),u}},output:{rgb:function(a){var r=a.h,t=a.s,n=a.l,e=a.alpha,o={mode:"rgb"};r=(void 0===r?0:r+120)*V;var i=void 0===t?0:t*n*(1-n),h=Math.cos(r),u=Math.sin(r);return o.r=n+i*(U[0]*h+U[1]*u),o.g=n+i*(U[2]*h+U[3]*u),o.b=n+i*(U[4]*h+U[5]*u),void 0!==e&&(o.alpha=e),o}},interpolate:{h:y(A),s:y(),l:y(),alpha:y(k)}};function ra(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=Math.sqrt(t*t+n*n),i={mode:"dlch",l:r,c:o};return o&&(i.h=j(180*Math.atan2(n,t)/Math.PI)),void 0!==e&&(i.alpha=e),i}var ta=26/180*Math.PI,na=Math.cos(ta),ea=Math.sin(ta),oa=100/Math.log(1.39);function ia(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"lab",l:(Math.exp(1*r/oa)-1)/.0039};if(void 0===n)o.a=o.b=0;else{var i=(Math.exp(.0435*t*1*1)-1)/.075,h=i*Math.cos(n/180*Math.PI-ta),u=i*Math.sin(n/180*Math.PI-ta);o.a=h*na-u/.83*ea,o.b=h*ea+u/.83*na}return void 0!==e&&(o.alpha=e),o}function ha(a){return ia(ra(a))}function ua(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=t*na+n*ea,i=.83*(n*na-t*ea),h=Math.sqrt(o*o+i*i),u={mode:"dlch",l:oa/1*Math.log(1+.0039*r),c:Math.log(1+.075*h)/.0435};return u.c&&(u.h=(Math.atan2(i,o)+ta)/Math.PI*180),void 0!==e&&(u.alpha=e),u}function la(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"dlab",l:r,a:0===t?0:t*Math.cos(n/180*Math.PI),b:0===t?0:t*Math.sin(n/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}function ca(a){return la(ua(a))}var sa={mode:"dlab",output:{lab:ha,rgb:function(a){return B(ha(a))}},input:{lab:ca,rgb:function(a){return ca(K(a))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-39.229,45.166],b:[-43.002,44.424]},interpolate:{l:y(),a:y(),b:y(),alpha:y(k)}};var da={mode:"dlch",output:{lab:ia,dlab:la,rgb:function(a){return B(ia(a))}},input:{lab:ua,dlab:ra,rgb:function(a){return ua(K(a))}},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,50.944],h:[0,360]},interpolate:{l:y(),c:y(),h:y(A),alpha:y(k)}};var pa={mode:"yiq",output:{rgb:function(a){var r=a.y,t=a.i,n=a.q;return E({r:r+.95608445*t+.6208885*n,g:r-.27137664*t-.6486059*n,b:r-1.10561724*t+1.70250126*n,alpha:a.alpha})}},input:{rgb:function(a){var r=P(a),t=r.r,n=r.g,e=r.b,o=r.alpha,i={mode:"yiq",y:.29889531*t+.58662247*n+.11448223*e,i:.59597799*t-.2741761*n-.32180189*e,q:.21147017*t-.52261711*n+.31114694*e};return void 0!==o&&(i.alpha=o),i}},channels:["y","i","q","alpha"],ranges:{i:[-.593,.593],q:[-.52,.52]},interpolate:{y:y(),i:y(),q:y(),alpha:y(k)}},va={},fa={},ba=[],ga=function(a){va[a.mode]=Object.assign(va[a.mode]||{},a.output),Object.keys(a.input||{}).forEach((function(r){va[r]||(va[r]={}),va[r][a.mode]=a.input[r]})),a.ranges||(a.ranges={}),a.channels.forEach((function(r){void 0===a.ranges[r]&&(a.ranges[r]=[0,1])})),fa[a.mode]=a,(a.parsers||[]).forEach((function(a){return ba.push(a)}))},Ma=function(a){return fa[a]},ma=function(a){for(var r,t=0,n=ba.length;t<n&&void 0===(r=ba[t++](a)););return r};function wa(a,r){return void 0===a?void 0:"object"!=typeof a?ma(a):void 0!==a.mode?a:r?Object.assign({},a,{mode:r}):void 0}var ya=function(a){return void 0===a&&(a="rgb"),function(r){return void 0!==(r=wa(r,a))?r.mode===a?r:va[r.mode][a]?va[r.mode][a](r):"rgb"===a?va[r.mode].rgb(r):va.rgb[a](va[r.mode].rgb(r)):void 0}};function ka(a){return void 0===a&&(a=4),function(r){return"number"==typeof r?function(a,r){return Math.round(a*(r=Math.pow(10,r)))/r}(r,a):r}}function xa(a){return Math.round(255*Math.max(0,Math.min(a,1)))}var qa=ya("rgb"),Pa=ka(2),Ia=function(a){var r=qa(a);if(void 0!==r)return"#"+(1<<24|xa(r.r)<<16|xa(r.g)<<8|xa(r.b)).toString(16).slice(1)},Ea=function(a){var r=qa(a);if(void 0!==r){var t=xa(r.r),n=xa(r.g),e=xa(r.b);return void 0===r.alpha||1===r.alpha?"rgb("+t+", "+n+", "+e+")":"rgba("+t+", "+n+", "+e+", "+Pa(r.alpha)+")"}};function Ra(a){return void 0===a&&(a=.5),function(r){return a<=0?1:a>=1?0:Math.pow(r,Math.log(.5)/Math.log(a))}}var ja=function(a,r,t,n,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*a+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*t+i*n)/6};function $a(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return function(a){a=Math.pow(a,t);var n=e.length-1,o=1===a?n-1:Math.floor(a*n);switch(r){case"default":return ja(o>0?e[o-1]:2*e[o]-e[o+1],e[o],e[o+1],o<n-1?e[o+2]:2*e[o+1]-e[o],(a-o/n)*n);case"closed":return ja(e[(o-1+e.length)%e.length],e[o],e[(o+1)%e.length],e[(o+2)%e.length],(a-o/n)*n);case"open":throw new Error("open basis spline is not yet implemented")}}}}var Aa=function(a,r,t,n,e,o){var i=o*o,h=(t-a)/(2*e),u=(n-r)/(2*e),l=(t-r)/e;return(h+u-2*l)/(e*e)*(i*o)+(3*l-2*h-u)/e*i+h*o+r};var Ca=ya("rgb");function Oa(a){var r=Ca(a);return void 0!==r&&r.r>=0&&r.r<=1&&r.g>=0&&r.g<=1&&r.b>=0&&r.b<=1}var Sa=ya("lch"),za=ya("rgb"),Na=function(a){var r=za(a);return r.r=Math.max(0,Math.min(r.r,1)),r.g=Math.max(0,Math.min(r.g,1)),r.b=Math.max(0,Math.min(r.b,1)),r},Da=function(a){return void 0===(a=wa(a))||Oa(a)?a:ya(a.mode)(Na(a))},La=function(a){if(void 0===(a=wa(a))||Oa(a))return a;var r=ya(a.mode);a=Sa(a);var t=Object.assign({},a,{c:0});if(!Oa(t))return r(Na(a));for(var n=0,e=a.c;e-n>.01;)t.c=n+.5*(e-n),Oa(t)?n=t.c:e=t.c;return r(t)},Ha=function(a,r){void 0===a&&(a="rgb"),void 0===r&&(r=[1,1,1,0]);var t=Ma(a).channels,n=ya(a);return function(a,e){var o=n(a),i=n(e);return Math.sqrt(t.reduce((function(a,t,n){var e,h,u,l,c="h"===t?(e=o[t],h=i[t],u=j(e),l=j(h),Math.abs(l-u)>180?u-(l-360*Math.sign(l-u)):u-l):o[t]-i[t];return a+(r[n]||0)*Math.pow(isNaN(c)?0:c,2)}),0))}},_a=function(a){return a};var Ba={normal:function(a,r){return r},multiply:function(a,r){return a*r},screen:function(a,r){return a+r-a*r},"hard-light":function(a,r){return r<.5?2*a*r:2*r*(1-a)-1},overlay:function(a,r){return a<.5?2*r*a:2*a*(1-r)-1},darken:function(a,r){return Math.min(a,r)},lighten:function(a,r){return Math.max(a,r)},"color-dodge":function(a,r){return 0===a?0:1===r?1:Math.min(1,a/(1-r))},"color-burn":function(a,r){return 1===a?1:0===r?0:1-Math.min(1,(1-a)/r)},"soft-light":function(a,r){return r<.5?a-(1-2*r)*a*(1-a):a+(2*r-1)*((a<.25?((16*a-12)*a+4)*a:Math.sqrt(a))-a)},difference:function(a,r){return Math.abs(a-r)},exclusion:function(a,r){return a+r-2*a*r}};function Fa(a){var r=ya("lrgb")(a);return.2126*r.r+.7152*r.g+.0722*r.b}var Ka=ya("rgb"),Ta=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],Ga=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],Ja=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],Qa=function(a,r){var t=Math.max(0,Math.min(1,r)),n=Math.round(t/.1),e=Math.round(t%.1),o=a[n];if(e>0&&n<a.length-1){var i=a[n+1];o=o.map((function(a,r){return function(a,r,t){return(1-t)*a+t*r}(o[r],i[r],e)}))}return function(a){var r=wa(a);if(void 0!==r){var t=Ka(r),n=t.r,e=t.g,i=t.b,h={mode:"rgb",r:o[0]*n+o[1]*e+o[2]*i,g:o[3]*n+o[4]*e+o[5]*i,b:o[6]*n+o[7]*e+o[8]*i};return void 0!==r.alpha&&(h.alpha=r.alpha),ya(r.mode)(h)}}};ga(x),ga(R),ga(C),ga(z),ga(N),ga(D),ga(T),ga(Q),ga(aa),ga(sa),ga(da),ga(pa);var Ua=ya("rgb"),Va=ya("lrgb"),Wa=ya("hsl"),Xa=ya("hsv"),Ya=ya("hsi"),Za=ya("hwb"),ar=ya("lab"),rr=ya("lch"),tr=ya("cubehelix"),nr=ya("dlab"),er=ya("dlch"),or=ya("yiq");a.blend=function(a,r,t){void 0===r&&(r="normal"),void 0===t&&(t="rgb");var n="function"==typeof r?r:Ba[r],e=ya(t),o=Ma(t).channels;return a.map((function(a){var r=e(a);return void 0===r.alpha&&(r.alpha=1),r})).reduce((function(a,r){if(void 0===a)return r;var e=r.alpha+a.alpha*(1-r.alpha);return o.reduce((function(t,o){return"alpha"!==o&&(0===e?t[o]=0:(t[o]=r.alpha*(1-a.alpha)*r[o]+r.alpha*a.alpha*n(a[o],r[o])+(1-r.alpha)*a.alpha*a[o],t[o]=Math.max(0,Math.min(1,t[o]/e)))),t}),{mode:t,alpha:e})}))},a.clamp=function(a){switch(void 0===a&&(a="rgb"),a){case"rgb":return Da;case"lch":return La}},a.clampChroma=La,a.clampRgb=Da,a.colorsNamed=t,a.converter=ya,a.cubehelix=tr,a.deficiencyDeuter=function(a){return void 0===a&&(a=1),Qa(Ga,a)},a.deficiencyProt=function(a){return void 0===a&&(a=1),Qa(Ta,a)},a.deficiencyTrit=function(a){return void 0===a&&(a=1),Qa(Ja,a)},a.defineMode=ga,a.differenceCie76=function(){return Ha("lab")},a.differenceCie94=function(a,r,t){void 0===a&&(a=1),void 0===r&&(r=.045),void 0===t&&(t=.015);var n=ya("lab");return function(e,o){var i=n(e),h=n(o),u=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),d=h.l,p=h.a,v=h.b,f=Math.sqrt(p*p+v*v),b=Math.pow(u-d,2),g=Math.pow(s-f,2),M=Math.pow(l-p,2)+Math.pow(c-v,2)-g;return Math.sqrt(b/Math.pow(a,2)+g/Math.pow(1+r*s,2)+M/Math.pow(1+t*s,2))}},a.differenceCiede2000=function(a,r,t){void 0===a&&(a=1),void 0===r&&(r=1),void 0===t&&(t=1);var n=ya("lab");return function(e,o){var i=n(e),h=n(o),u=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),d=h.l,p=h.a,v=h.b,f=(s+Math.sqrt(p*p+v*v))/2,b=.5*(1-Math.sqrt(Math.pow(f,7)/(Math.pow(f,7)+Math.pow(25,7)))),g=l*(1+b),M=p*(1+b),m=Math.sqrt(g*g+c*c),w=Math.sqrt(M*M+v*v),y=Math.abs(g)+Math.abs(c)===0?0:Math.atan2(c,g);y+=2*(y<0)*Math.PI;var k=Math.abs(M)+Math.abs(v)===0?0:Math.atan2(v,M);k+=2*(k<0)*Math.PI;var x=d-u,q=w-m,P=m*w==0?0:k-y;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var I,E=2*Math.sqrt(m*w)*Math.sin(P/2),R=(u+d)/2,j=(m+w)/2;m*w==0?I=y+k:(I=(y+k)/2,I-=(Math.abs(y-k)>Math.PI)*Math.PI,I+=2*(I<0)*Math.PI);var $=Math.pow(R-50,2),A=1-.17*Math.cos(I-Math.PI/6)+.24*Math.cos(2*I)+.32*Math.cos(3*I+Math.PI/30)-.2*Math.cos(4*I-63*Math.PI/180),C=1+.015*$/Math.sqrt(20+$),O=1+.045*j,S=1+.015*j*A,z=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),N=2*Math.sqrt(Math.pow(j,7)/(Math.pow(j,7)+Math.pow(25,7))),D=-1*Math.sin(2*z)*N;return Math.sqrt(Math.pow(x/(a*C),2)+Math.pow(q/(r*O),2)+Math.pow(E/(t*S),2)+D*q/(r*O)*E/(t*S))}},a.differenceCmc=function(a,r){void 0===a&&(a=1),void 0===r&&(r=1);var t=ya("lab");return function(n,e){var o=t(n),i=o.l,h=o.a,u=o.b,l=Math.sqrt(h*h+u*u),c=Math.atan2(u,h);c+=2*Math.PI*(c<0);var s=t(e),d=s.l,p=s.a,v=s.b,f=Math.sqrt(p*p+v*v),b=Math.pow(i-d,2),g=Math.pow(l-f,2),M=Math.pow(h-p,2)+Math.pow(u-v,2)-g,m=Math.sqrt(Math.pow(l,4)/(Math.pow(l,4)+1900)),w=i<16?.511:.040975*i/(1+.01765*i),y=.0638*l/(1+.0131*l)+.638,k=y*(m*(c>=164/180*Math.PI&&c<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(c+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(c+35/180*Math.PI)))+1-m);return Math.sqrt(b/Math.pow(a*w,2)+g/Math.pow(r*y,2)+M/Math.pow(k,2))}},a.differenceDin99o=function(){return Ha("dlab")},a.differenceEuclidean=Ha,a.differenceKotsarenkoRamos=function(){return Ha("yiq",[.5053,.299,.1957])},a.displayable=Oa,a.dlab=nr,a.dlch=er,a.easingMidpoint=Ra,a.easingSmootherstep=function(a){return a*a*a*(a*(6*a-15)+10)},a.easingSmoothstep=function(a){return a*a*(3-2*a)},a.formatHex=Ia,a.formatRgb=Ea,a.formatter=function(a){switch(void 0===a&&(a="rgb"),a){case"rgb":return Ea;case"hex":return Ia}},a.getModeDefinition=Ma,a.hsi=Ya,a.hsl=Wa,a.hsv=Xa,a.hwb=Za,a.interpolate=function(a,r,t){void 0===r&&(r="rgb");var n=Ma(r),e=ya(r),o=[],i=[],h={};a.forEach((function(a){Array.isArray(a)?(o.push(e(a[0])),i.push(a[1])):"number"==typeof a||"function"==typeof a?h[i.length]=a:(o.push(e(a)),i.push(void 0))})),function(a){void 0===a[0]&&(a[0]=0),void 0===a[a.length-1]&&(a[a.length-1]=1);for(var r,t,n,e,o=1;o<a.length;){if(void 0===a[o]){for(t=o,n=a[o-1],r=o;void 0===a[r];)r++;for(e=(a[r]-n)/(r-o+1);o<r;)a[o]=n+(o+1-t)*e,o++}else a[o]<a[o-1]&&(a[o]=a[o-1]);o++}}(i);var u=n.channels.reduce((function(a,r){return a[r]=o.map((function(a){return a[r]})),a}),{}),l=n.channels.reduce((function(a,r){return a[r]=a[r](u[r]),a}),Object.assign({},n.interpolate,t)),c=o.length-1;return function(a){if((a=Math.min(Math.max(0,a),1))<=i[0])return o[0];if(a>i[c])return o[c];for(var t=0;i[t]<a;)t++;var e=i[t-1],u=i[t]-e,s=(a-e)/u,d=h[t];void 0!==d&&("number"==typeof d&&(d=Ra((d-e)/u)),s=d(s));var p=(t-1+s)/c;return n.channels.reduce((function(a,r){var t=l[r](p);return void 0!==t&&(a[r]=t),a}),{mode:r})}},a.interpolateAlpha=k,a.interpolateCosine=function(a,r){return void 0===a&&(a=w),void 0===r&&(r=1),function(t){var n=(a||w)(n);return function(t){var e=(t=Math.pow(t,r))*(n.length-1),o=Math.floor(e),i=n[o],h=n[o+1],u=e-o,l=a([i,h],u);if("object"==typeof l){i=l[0],h=l[1];var c=(1-Math.cos(u*Math.PI))/2;return i*(1-c)+h*c}return l}}},a.interpolateHue=A,a.interpolateLinear=y,a.interpolateSplineBasis=$a,a.interpolateSplineMonotone=function(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return function(a){a=Math.pow(a,t);var n,o=e.length-1;switch(1===a?(n=o-1,a=1):n=Math.floor(a*o),r){case"default":return Aa(n>0?e[n-1]:2*e[n]-e[n+1],e[n],e[n+1],n<o-1?e[n+2]:2*e[n+1]-e[n],1/o,a-n/o);case"closed":return Aa(e[(n-1+e.length)%e.length],e[n],e[(n+1)%e.length],e[(n+2)%e.length],1/o,a-n/o);case"open":throw new Error("open monotone spline not implemented yet")}}}},a.interpolateSplineNatural=function(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return $a(w,r,t)(function(a){var r,t=a.length-1,n=new Array(t),e=new Array(t),o=new Array(t);for(n[1]=1/4,e[1]=(6*a[1]-a[0])/4,r=2;r<t;++r)n[r]=1/(4-n[r-1]),e[r]=(6*a[r]-(r==t-1?a[t]:0)-e[r-1])*n[r];for(o[0]=a[0],o[t]=a[t],t-1>0&&(o[t-1]=e[t-1]),r=t-2;r>0;--r)o[r]=e[r]-n[r]*o[r+1];return o}(e))}},a.lab=ar,a.lch=rr,a.lrgb=Va,a.nearest=function(a,r,t){void 0===r&&(r=Ha()),void 0===t&&(t=_a);var n=a.map((function(a,r){return{color:t(a),i:r}}));return function(t,e,o){return void 0===e&&(e=1),void 0===o&&(o=1/0),isFinite(e)&&(e=Math.max(1,Math.min(e,n.length-1))),n.forEach((function(a){a.d=r(t,a.color)})),n.sort((function(a,r){return a.d-r.d})).slice(0,e).filter((function(a){return a.d<o})).map((function(r){return a[r.i]}))}},a.parse=ma,a.random=function(a,r){void 0===a&&(a="rgb"),void 0===r&&(r={});var t=Ma(a),n=function(a){return Object.keys(a).reduce((function(r,t){var n=a[t];return r[t]=Array.isArray(n)?n:[n,n],r}),{})}(r);return t.channels.reduce((function(a,r){var e,o,i;return(n.alpha||"alpha"!==r)&&(a[r]=(e=n[r]||t.ranges[r],o=e[0],i=e[1],o+Math.random()*(i-o))),a}),{mode:a})},a.rgb=Ua,a.round=ka,a.samples=function(a,r){if(void 0===a&&(a=2),void 0===r&&(r=1),a<2)return a<1?[]:[Math.pow(.5,r)];for(var t=[],n=0;n<a;n++)t.push(Math.pow(n/(a-1),r));return t},a.wcagContrast=function(a,r){var t=Fa(a),n=Fa(r);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)},a.wcagLuminance=Fa,a.yiq=or,Object.defineProperty(a,"__esModule",{value:!0})}));
!function(a,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((a=a||self).culori={})}(this,(function(a){"use strict";function r(a,r){if("number"==typeof a)return 3===r?{mode:"rgb",r:(a>>8&15|a>>4&240)/255,g:(a>>4&15|240&a)/255,b:(15&a|a<<4&240)/255}:4===r?{mode:"rgb",r:(a>>12&15|a>>8&240)/255,g:(a>>8&15|a>>4&240)/255,b:(a>>4&15|240&a)/255,alpha:(15&a|a<<4&240)/255}:6===r?{mode:"rgb",r:(a>>16&255)/255,g:(a>>8&255)/255,b:(255&a)/255}:8===r?{mode:"rgb",r:(a>>24&255)/255,g:(a>>16&255)/255,b:(a>>8&255)/255,alpha:(255&a)/255}:void 0}var t={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var n=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=n+"%",o=n+"%?",i="(?:"+n+"%|"+n+")",h="(?:"+n+"(deg|grad|rad|turn)|"+n+")",u="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+n+u+n+u+n+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),s=new RegExp("^rgba?\\(\\s*"+e+u+e+u+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),d=new RegExp("^rgba?\\(\\s*"+n+l+n+l+n+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+h+u+e+u+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),f=new RegExp("^hsla?\\(\\s*"+h+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+h+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+o+l+n+l+n+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+o+l+n+l+h+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$");function w(a){return a}function y(a,r){return void 0===a&&(a=w),void 0===r&&(r=1),function(t){var n=function(a){for(var r=[],t=0;t<a.length-1;t++){var n=a[t],e=a[t+1];void 0===n&&void 0===e?r.push(void 0):void 0!==n&&void 0!==e?r.push([n,e]):r.push(void 0!==n?[n,n]:[e,e])}return r}((a||w)(t));return function(a){var t=(a=Math.pow(a,r))*n.length,e=1===a?n.length-1:Math.floor(t),o=n[e];return void 0===o?void 0:o[0]+(t-e)*(o[1]-o[0])}}}function k(a){return a.map((function(a,r,t){return void 0===a&&void 0!==t[r+1]?1:a}))}var x={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(a){var t;return(t=a.match(b))?r(parseInt(t[1],16),t[1].length):void 0},function(a){var r,t;if(r=a.match(c)||a.match(d))t={mode:"rgb",r:r[1]/255,g:r[2]/255,b:r[3]/255};else{if(!(r=a.match(s)||a.match(p)))return;t={mode:"rgb",r:r[1]/100,g:r[2]/100,b:r[3]/100}}return void 0!==r[4]?t.alpha=r[4]/100:void 0!==r[5]&&(t.alpha=+r[5]),t},function(a){return"string"==typeof a&&r(t[a.toLowerCase()],6)||void 0},function(a){return"transparent"===a?r(0,8):void 0}],interpolate:{r:y(),g:y(),b:y(),alpha:y(k)}},q=function(a){return a<.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)};function P(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o={mode:"lrgb",r:q(r),g:q(t),b:q(n)};return void 0!==e&&(o.alpha=e),o}var I=function(a){return a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a};function E(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o={mode:"rgb",r:I(r),g:I(t),b:I(n)};return void 0!==e&&(o.alpha=e),o}var R={mode:"lrgb",output:{rgb:E},input:{rgb:P},channels:["r","g","b","alpha"],interpolate:{r:y(),g:y(),b:y(),alpha:y(k)}};function j(a){return(a%=360)<0?a+360:a}var $=function(a,r){switch(r){case"deg":return+a;case"rad":return a/Math.PI*180;case"grad":return a/10*9;case"turn":return 360*a}};function A(a){for(var r=[],t=0;t<a.length;t++)if(void 0!==a[t]){var n=j(a[t]),e=void 0;0!==t&&void 0!==(e=r[r.length-1])?r.push(Math.abs(n-e)>180?n-360*Math.sign(n-e):n):r.push(n)}else r.push(void 0);return r}var C={mode:"hsl",output:{rgb:function(a){var r=a.h,t=a.s,n=a.l,e=a.alpha;r=j(r);var o,i=n+t*(n<.5?n:1-n),h=i-2*(i-n)*Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:i,g:h,b:2*n-i};break;case 1:o={r:h,g:i,b:2*n-i};break;case 2:o={r:2*n-i,g:i,b:h};break;case 3:o={r:2*n-i,g:h,b:i};break;case 4:o={r:h,g:2*n-i,b:i};break;case 5:o={r:i,g:2*n-i,b:h};break;default:o={r:2*n-i,g:2*n-i,b:2*n-i}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(v)||a.match(f);if(r){var t={mode:"hsl",h:void 0===r[3]?$(r[1],r[2]):+r[3],s:Math.min(Math.max(0,r[4]/100),1),l:Math.min(Math.max(0,r[5]/100),1)};return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=r[7]/255),t}}}],interpolate:{h:y(A),s:y(),l:y(),alpha:y(k)}};function O(a){var r=a.h,t=a.s,n=a.v,e=a.alpha;r=j(r);var o,i=Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:n,g:n*(1-t*i),b:n*(1-t)};break;case 1:o={r:n*(1-t*i),g:n,b:n*(1-t)};break;case 2:o={r:n*(1-t),g:n,b:n*(1-t*i)};break;case 3:o={r:n*(1-t),g:n*(1-t*i),b:n};break;case 4:o={r:n*(1-t*i),g:n*(1-t),b:n};break;case 5:o={r:n,g:n*(1-t),b:n*(1-t*i)};break;default:o={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}function S(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}var z={mode:"hsv",output:{rgb:O},input:{rgb:S},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:y(A),s:y(),v:y(),alpha:y(k)}};var N={mode:"hsi",output:{rgb:function(a){var r=a.h,t=a.s,n=a.i,e=a.alpha;r=j(r);var o,i=Math.abs(r/60%2-1);switch(Math.floor(r/60)){case 0:o={r:n*(1+t*(3/(2-i)-1)),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1-t)};break;case 1:o={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1+t*(3/(2-i)-1)),b:n*(1-t)};break;case 2:o={r:n*(1-t),g:n*(1+t*(3/(2-i)-1)),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;case 3:o={r:n*(1-t),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1+t*(3/(2-i)-1))};break;case 4:o={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3/(2-i)-1))};break;case 5:o={r:n*(1+t*(3/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;default:o={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=Math.max(r,t,n),i=Math.min(r,t,n),h={mode:"hsi",s:r+t+n===0?0:1-3*i/(r+t+n),i:(r+t+n)/3};return o-i!=0&&(h.h=60*(o===r?(t-n)/(o-i)+6*(t<n):o===t?(n-r)/(o-i)+2:(r-t)/(o-i)+4)),void 0!==e&&(h.alpha=e),h}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:y(A),s:y(),i:y(),alpha:y(k)}};var D={mode:"hwb",output:{rgb:function(a){var r=a.h,t=a.w,n=a.b;if(t+n>1){var e=t+n;t/=e,n/=e}return O({h:r,s:1===n?1:1-t/(1-n),v:1-n,alpha:a.alpha})}},input:{rgb:function(a){var r=S(a);if(void 0!==r){var t={mode:"hwb",w:(1-r.s)*r.v,b:1-r.v};return void 0!==r.h&&(t.h=r.h),void 0!==r.alpha&&(t.alpha=r.alpha),t}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(g);if(r){var t={mode:"hwb",h:void 0===r[3]?$(r[1],r[2]):+r[3],w:r[4]/100,b:r[5]/100};if(t.w+t.b>1){var n=t.w+t.b;t.w/=n,t.b/=n}return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=r[7]/255),t}}}],interpolate:{h:y(A),w:y(),b:y(),alpha:y(k)}},L=Math.pow(29,3)/Math.pow(3,3),H=Math.pow(6,3)/Math.pow(29,3),_=function(a){return Math.pow(a,3)>H?Math.pow(a,3):(116*a-16)/L};function B(a){var r,t,n,e,o,i=function(a){var r=a.x,t=a.y,n=a.z;return E({r:3.1338561*r-1.6168667*t-.4906146*n,g:-.9787684*r+1.9161415*t+.033454*n,b:.0719453*r-.2289914*t+1.4052427*n})}((t=(r=a).l,n=r.a,o=(e=(t+16)/116)-r.b/200,{x:.96422*_(n/500+e),y:1*_(e),z:.82521*_(o)}));return i.mode="rgb",void 0!==a.alpha&&(i.alpha=a.alpha),i}var F=function(a){return a>H?Math.cbrt(a):(L*a+16)/116};function K(a){var r=function(a){var r=a.x,t=a.y,n=a.z,e=F(r/.96422),o=F(t/1);return{mode:"lab",l:116*o-16,a:500*(e-o),b:200*(o-F(n/.82521))}}(function(a){var r=P(a),t=r.r,n=r.g,e=r.b;return{x:.4360747*t+.3850649*n+.1430804*e,y:.2225045*t+.7168786*n+.0606169*e,z:.0139322*t+.0971045*n+.7141733*e}}(a));return a.r===a.b===a.g&&(r.a=r.b=0),void 0!==a.alpha&&(r.alpha=a.alpha),r}var T={mode:"lab",output:{rgb:B},input:{rgb:K},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.167,93.408],b:[-111.859,93.246]},parsers:[function(a){if("string"==typeof a){var r=a.match(M);if(r){var t={mode:"lab",l:+r[1],a:+r[2],b:+r[3]};return void 0!==r[4]?t.alpha=r[4]/100:void 0!==r[5]&&(t.alpha=+r[5]),t}}}],interpolate:{l:y(),a:y(),b:y(),alpha:y(k)}};function G(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=Math.sqrt(t*t+n*n),i={mode:"lch",l:r,c:o};return o&&(i.h=j(180*Math.atan2(n,t)/Math.PI)),void 0!==e&&(i.alpha=e),i}function J(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"lab",l:r,a:0===t?0:t*Math.cos(n/180*Math.PI),b:0===t?0:t*Math.sin(n/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}var Q={mode:"lch",output:{lab:J,rgb:function(a){return B(J(a))}},input:{rgb:function(a){return G(K(a))},lch:G},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(a){if("string"==typeof a){var r=a.match(m);if(r){var t={mode:"lch",l:+r[1],c:Math.max(0,+r[2]),h:void 0===r[5]?$(r[3],r[4]):+r[5]};return void 0!==r[6]?t.alpha=r[6]/100:void 0!==r[7]&&(t.alpha=+r[7]),t}}}],interpolate:{h:y(A),c:y(),l:y(),alpha:y(k)}},U=[-.14861,1.78277,-.29227,-.90649,1.97294,0],V=Math.PI/180,W=180/Math.PI,X=U[3]*U[4],Y=U[1]*U[4],Z=U[1]*U[2]-U[0]*U[3];var aa={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(a){var r=a.r,t=a.g,n=a.b,e=a.alpha,o=(Z*n+r*X-t*Y)/(Z+X-Y),i=n-o,h=(U[4]*(t-o)-U[2]*i)/U[3],u={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+h*h)/(U[4]*o*(1-o))};return u.s&&(u.h=Math.atan2(h,i)*W-120),void 0!==e&&(u.alpha=e),u}},output:{rgb:function(a){var r=a.h,t=a.s,n=a.l,e=a.alpha,o={mode:"rgb"};r=(void 0===r?0:r+120)*V;var i=void 0===t?0:t*n*(1-n),h=Math.cos(r),u=Math.sin(r);return o.r=n+i*(U[0]*h+U[1]*u),o.g=n+i*(U[2]*h+U[3]*u),o.b=n+i*(U[4]*h+U[5]*u),void 0!==e&&(o.alpha=e),o}},interpolate:{h:y(A),s:y(),l:y(),alpha:y(k)}};function ra(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=Math.sqrt(t*t+n*n),i={mode:"dlch",l:r,c:o};return o&&(i.h=j(180*Math.atan2(n,t)/Math.PI)),void 0!==e&&(i.alpha=e),i}var ta=26/180*Math.PI,na=Math.cos(ta),ea=Math.sin(ta),oa=100/Math.log(1.39);function ia(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"lab",l:(Math.exp(1*r/oa)-1)/.0039};if(void 0===n)o.a=o.b=0;else{var i=(Math.exp(.0435*t*1*1)-1)/.075,h=i*Math.cos(n/180*Math.PI-ta),u=i*Math.sin(n/180*Math.PI-ta);o.a=h*na-u/.83*ea,o.b=h*ea+u/.83*na}return void 0!==e&&(o.alpha=e),o}function ha(a){return ia(ra(a))}function ua(a){var r=a.l,t=a.a,n=a.b,e=a.alpha,o=t*na+n*ea,i=.83*(n*na-t*ea),h=Math.sqrt(o*o+i*i),u={mode:"dlch",l:oa/1*Math.log(1+.0039*r),c:Math.log(1+.075*h)/.0435};return u.c&&(u.h=(Math.atan2(i,o)+ta)/Math.PI*180),void 0!==e&&(u.alpha=e),u}function la(a){var r=a.l,t=a.c,n=a.h,e=a.alpha,o={mode:"dlab",l:r,a:0===t?0:t*Math.cos(n/180*Math.PI),b:0===t?0:t*Math.sin(n/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}function ca(a){return la(ua(a))}var sa={mode:"dlab",output:{lab:ha,rgb:function(a){return B(ha(a))}},input:{lab:ca,rgb:function(a){return ca(K(a))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-39.229,45.166],b:[-43.002,44.424]},interpolate:{l:y(),a:y(),b:y(),alpha:y(k)}};var da={mode:"dlch",output:{lab:ia,dlab:la,rgb:function(a){return B(ia(a))}},input:{lab:ua,dlab:ra,rgb:function(a){return ua(K(a))}},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,50.944],h:[0,360]},interpolate:{l:y(),c:y(),h:y(A),alpha:y(k)}};var pa={mode:"yiq",output:{rgb:function(a){var r=a.y,t=a.i,n=a.q;return E({r:r+.95608445*t+.6208885*n,g:r-.27137664*t-.6486059*n,b:r-1.10561724*t+1.70250126*n,alpha:a.alpha})}},input:{rgb:function(a){var r=P(a),t=r.r,n=r.g,e=r.b,o=r.alpha,i={mode:"yiq",y:.29889531*t+.58662247*n+.11448223*e,i:.59597799*t-.2741761*n-.32180189*e,q:.21147017*t-.52261711*n+.31114694*e};return void 0!==o&&(i.alpha=o),i}},channels:["y","i","q","alpha"],ranges:{i:[-.593,.593],q:[-.52,.52]},interpolate:{y:y(),i:y(),q:y(),alpha:y(k)}},va={},fa={},ba=[],ga=function(a){va[a.mode]=Object.assign(va[a.mode]||{},a.output),Object.keys(a.input||{}).forEach((function(r){va[r]||(va[r]={}),va[r][a.mode]=a.input[r]})),a.ranges||(a.ranges={}),a.channels.forEach((function(r){void 0===a.ranges[r]&&(a.ranges[r]=[0,1])})),fa[a.mode]=a,(a.parsers||[]).forEach((function(a){return ba.push(a)}))},Ma=function(a){return fa[a]},ma=function(a){for(var r,t=0,n=ba.length;t<n&&void 0===(r=ba[t++](a)););return r};function wa(a,r){return void 0===a?void 0:"object"!=typeof a?ma(a):void 0!==a.mode?a:r?Object.assign({},a,{mode:r}):void 0}var ya=function(a){return void 0===a&&(a="rgb"),function(r){return void 0!==(r=wa(r,a))?r.mode===a?r:va[r.mode][a]?va[r.mode][a](r):"rgb"===a?va[r.mode].rgb(r):va.rgb[a](va[r.mode].rgb(r)):void 0}};function ka(a){return void 0===a&&(a=4),function(r){return"number"==typeof r?function(a,r){return Math.round(a*(r=Math.pow(10,r)))/r}(r,a):r}}function xa(a){return Math.round(255*Math.max(0,Math.min(a,1)))}var qa=ya("rgb"),Pa=ka(2),Ia=function(a){var r=qa(a);if(void 0!==r)return"#"+(1<<24|xa(r.r)<<16|xa(r.g)<<8|xa(r.b)).toString(16).slice(1)},Ea=function(a){var r=qa(a);if(void 0!==r){var t=xa(r.r),n=xa(r.g),e=xa(r.b);return void 0===r.alpha||1===r.alpha?"rgb("+t+", "+n+", "+e+")":"rgba("+t+", "+n+", "+e+", "+Pa(r.alpha)+")"}};function Ra(a){return void 0===a&&(a=.5),function(r){return a<=0?1:a>=1?0:Math.pow(r,Math.log(.5)/Math.log(a))}}var ja=function(a,r,t,n,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*a+(4-6*o+3*i)*r+(1+3*e+3*o-3*i)*t+i*n)/6};function $a(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return function(a){a=Math.pow(a,t);var n=e.length-1,o=1===a?n-1:Math.floor(a*n);switch(r){case"default":return ja(o>0?e[o-1]:2*e[o]-e[o+1],e[o],e[o+1],o<n-1?e[o+2]:2*e[o+1]-e[o],(a-o/n)*n);case"closed":return ja(e[(o-1+e.length)%e.length],e[o],e[(o+1)%e.length],e[(o+2)%e.length],(a-o/n)*n);case"open":throw new Error("open basis spline is not yet implemented")}}}}var Aa=Math.sign,Ca=Math.min,Oa=Math.abs,Sa=function(a,r,t,n,e,o){var i=e*e,h=o*o,u=h*o,l=(r-a)/e,c=(t-r)/e,s=(n-t)/e,d=(Aa(l)+Aa(c))*Ca(Oa(l),Oa(c),.5*Oa((t-a)/(2*e))),p=(Aa(c)+Aa(s))*Ca(Oa(c),Oa(s),.5*Oa((n-r)/(2*e)));return(d+p-2*si)/i*u+(3*si-2*d-p)/e*h+d*o+r};var za=ya("rgb");function Na(a){var r=za(a);return void 0!==r&&r.r>=0&&r.r<=1&&r.g>=0&&r.g<=1&&r.b>=0&&r.b<=1}var Da=ya("lch"),La=ya("rgb"),Ha=function(a){var r=La(a);return r.r=Math.max(0,Math.min(r.r,1)),r.g=Math.max(0,Math.min(r.g,1)),r.b=Math.max(0,Math.min(r.b,1)),r},_a=function(a){return void 0===(a=wa(a))||Na(a)?a:ya(a.mode)(Ha(a))},Ba=function(a){if(void 0===(a=wa(a))||Na(a))return a;var r=ya(a.mode);a=Da(a);var t=Object.assign({},a,{c:0});if(!Na(t))return r(Ha(a));for(var n=0,e=a.c;e-n>.01;)t.c=n+.5*(e-n),Na(t)?n=t.c:e=t.c;return r(t)},Fa=function(a,r){void 0===a&&(a="rgb"),void 0===r&&(r=[1,1,1,0]);var t=Ma(a).channels,n=ya(a);return function(a,e){var o=n(a),i=n(e);return Math.sqrt(t.reduce((function(a,t,n){var e,h,u,l,c="h"===t?(e=o[t],h=i[t],u=j(e),l=j(h),Math.abs(l-u)>180?u-(l-360*Math.sign(l-u)):u-l):o[t]-i[t];return a+(r[n]||0)*Math.pow(isNaN(c)?0:c,2)}),0))}},Ka=function(a){return a};var Ta={normal:function(a,r){return r},multiply:function(a,r){return a*r},screen:function(a,r){return a+r-a*r},"hard-light":function(a,r){return r<.5?2*a*r:2*r*(1-a)-1},overlay:function(a,r){return a<.5?2*r*a:2*a*(1-r)-1},darken:function(a,r){return Math.min(a,r)},lighten:function(a,r){return Math.max(a,r)},"color-dodge":function(a,r){return 0===a?0:1===r?1:Math.min(1,a/(1-r))},"color-burn":function(a,r){return 1===a?1:0===r?0:1-Math.min(1,(1-a)/r)},"soft-light":function(a,r){return r<.5?a-(1-2*r)*a*(1-a):a+(2*r-1)*((a<.25?((16*a-12)*a+4)*a:Math.sqrt(a))-a)},difference:function(a,r){return Math.abs(a-r)},exclusion:function(a,r){return a+r-2*a*r}};function Ga(a){var r=ya("lrgb")(a);return.2126*r.r+.7152*r.g+.0722*r.b}var Ja=ya("rgb"),Qa=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],Ua=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],Va=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],Wa=function(a,r){var t=Math.max(0,Math.min(1,r)),n=Math.round(t/.1),e=Math.round(t%.1),o=a[n];if(e>0&&n<a.length-1){var i=a[n+1];o=o.map((function(a,r){return function(a,r,t){return(1-t)*a+t*r}(o[r],i[r],e)}))}return function(a){var r=wa(a);if(void 0!==r){var t=Ja(r),n=t.r,e=t.g,i=t.b,h={mode:"rgb",r:o[0]*n+o[1]*e+o[2]*i,g:o[3]*n+o[4]*e+o[5]*i,b:o[6]*n+o[7]*e+o[8]*i};return void 0!==r.alpha&&(h.alpha=r.alpha),ya(r.mode)(h)}}};ga(x),ga(R),ga(C),ga(z),ga(N),ga(D),ga(T),ga(Q),ga(aa),ga(sa),ga(da),ga(pa);var Xa=ya("rgb"),Ya=ya("lrgb"),Za=ya("hsl"),ar=ya("hsv"),rr=ya("hsi"),tr=ya("hwb"),nr=ya("lab"),er=ya("lch"),or=ya("cubehelix"),ir=ya("dlab"),hr=ya("dlch"),ur=ya("yiq");a.blend=function(a,r,t){void 0===r&&(r="normal"),void 0===t&&(t="rgb");var n="function"==typeof r?r:Ta[r],e=ya(t),o=Ma(t).channels;return a.map((function(a){var r=e(a);return void 0===r.alpha&&(r.alpha=1),r})).reduce((function(a,r){if(void 0===a)return r;var e=r.alpha+a.alpha*(1-r.alpha);return o.reduce((function(t,o){return"alpha"!==o&&(0===e?t[o]=0:(t[o]=r.alpha*(1-a.alpha)*r[o]+r.alpha*a.alpha*n(a[o],r[o])+(1-r.alpha)*a.alpha*a[o],t[o]=Math.max(0,Math.min(1,t[o]/e)))),t}),{mode:t,alpha:e})}))},a.clamp=function(a){switch(void 0===a&&(a="rgb"),a){case"rgb":return _a;case"lch":return Ba}},a.clampChroma=Ba,a.clampRgb=_a,a.colorsNamed=t,a.converter=ya,a.cubehelix=or,a.deficiencyDeuter=function(a){return void 0===a&&(a=1),Wa(Ua,a)},a.deficiencyProt=function(a){return void 0===a&&(a=1),Wa(Qa,a)},a.deficiencyTrit=function(a){return void 0===a&&(a=1),Wa(Va,a)},a.defineMode=ga,a.differenceCie76=function(){return Fa("lab")},a.differenceCie94=function(a,r,t){void 0===a&&(a=1),void 0===r&&(r=.045),void 0===t&&(t=.015);var n=ya("lab");return function(e,o){var i=n(e),h=n(o),u=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),d=h.l,p=h.a,v=h.b,f=Math.sqrt(p*p+v*v),b=Math.pow(u-d,2),g=Math.pow(s-f,2),M=Math.pow(l-p,2)+Math.pow(c-v,2)-g;return Math.sqrt(b/Math.pow(a,2)+g/Math.pow(1+r*s,2)+M/Math.pow(1+t*s,2))}},a.differenceCiede2000=function(a,r,t){void 0===a&&(a=1),void 0===r&&(r=1),void 0===t&&(t=1);var n=ya("lab");return function(e,o){var i=n(e),h=n(o),u=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),d=h.l,p=h.a,v=h.b,f=(s+Math.sqrt(p*p+v*v))/2,b=.5*(1-Math.sqrt(Math.pow(f,7)/(Math.pow(f,7)+Math.pow(25,7)))),g=l*(1+b),M=p*(1+b),m=Math.sqrt(g*g+c*c),w=Math.sqrt(M*M+v*v),y=Math.abs(g)+Math.abs(c)===0?0:Math.atan2(c,g);y+=2*(y<0)*Math.PI;var k=Math.abs(M)+Math.abs(v)===0?0:Math.atan2(v,M);k+=2*(k<0)*Math.PI;var x=d-u,q=w-m,P=m*w==0?0:k-y;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var I,E=2*Math.sqrt(m*w)*Math.sin(P/2),R=(u+d)/2,j=(m+w)/2;m*w==0?I=y+k:(I=(y+k)/2,I-=(Math.abs(y-k)>Math.PI)*Math.PI,I+=2*(I<0)*Math.PI);var $=Math.pow(R-50,2),A=1-.17*Math.cos(I-Math.PI/6)+.24*Math.cos(2*I)+.32*Math.cos(3*I+Math.PI/30)-.2*Math.cos(4*I-63*Math.PI/180),C=1+.015*$/Math.sqrt(20+$),O=1+.045*j,S=1+.015*j*A,z=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),N=2*Math.sqrt(Math.pow(j,7)/(Math.pow(j,7)+Math.pow(25,7))),D=-1*Math.sin(2*z)*N;return Math.sqrt(Math.pow(x/(a*C),2)+Math.pow(q/(r*O),2)+Math.pow(E/(t*S),2)+D*q/(r*O)*E/(t*S))}},a.differenceCmc=function(a,r){void 0===a&&(a=1),void 0===r&&(r=1);var t=ya("lab");return function(n,e){var o=t(n),i=o.l,h=o.a,u=o.b,l=Math.sqrt(h*h+u*u),c=Math.atan2(u,h);c+=2*Math.PI*(c<0);var s=t(e),d=s.l,p=s.a,v=s.b,f=Math.sqrt(p*p+v*v),b=Math.pow(i-d,2),g=Math.pow(l-f,2),M=Math.pow(h-p,2)+Math.pow(u-v,2)-g,m=Math.sqrt(Math.pow(l,4)/(Math.pow(l,4)+1900)),w=i<16?.511:.040975*i/(1+.01765*i),y=.0638*l/(1+.0131*l)+.638,k=y*(m*(c>=164/180*Math.PI&&c<=345/180*Math.PI?.56+Math.abs(.2*Math.cos(c+168/180*Math.PI)):.36+Math.abs(.4*Math.cos(c+35/180*Math.PI)))+1-m);return Math.sqrt(b/Math.pow(a*w,2)+g/Math.pow(r*y,2)+M/Math.pow(k,2))}},a.differenceDin99o=function(){return Fa("dlab")},a.differenceEuclidean=Fa,a.differenceKotsarenkoRamos=function(){return Fa("yiq",[.5053,.299,.1957])},a.displayable=Na,a.dlab=ir,a.dlch=hr,a.easingMidpoint=Ra,a.easingSmootherstep=function(a){return a*a*a*(a*(6*a-15)+10)},a.easingSmoothstep=function(a){return a*a*(3-2*a)},a.formatHex=Ia,a.formatRgb=Ea,a.formatter=function(a){switch(void 0===a&&(a="rgb"),a){case"rgb":return Ea;case"hex":return Ia}},a.getModeDefinition=Ma,a.hsi=rr,a.hsl=Za,a.hsv=ar,a.hwb=tr,a.interpolate=function(a,r,t){void 0===r&&(r="rgb");var n=Ma(r),e=ya(r),o=[],i=[],h={};a.forEach((function(a){Array.isArray(a)?(o.push(e(a[0])),i.push(a[1])):"number"==typeof a||"function"==typeof a?h[i.length]=a:(o.push(e(a)),i.push(void 0))})),function(a){void 0===a[0]&&(a[0]=0),void 0===a[a.length-1]&&(a[a.length-1]=1);for(var r,t,n,e,o=1;o<a.length;){if(void 0===a[o]){for(t=o,n=a[o-1],r=o;void 0===a[r];)r++;for(e=(a[r]-n)/(r-o+1);o<r;)a[o]=n+(o+1-t)*e,o++}else a[o]<a[o-1]&&(a[o]=a[o-1]);o++}}(i);var u=n.channels.reduce((function(a,r){return a[r]=o.map((function(a){return a[r]})),a}),{}),l=n.channels.reduce((function(a,r){return a[r]=a[r](u[r]),a}),Object.assign({},n.interpolate,t)),c=o.length-1;return function(a){if((a=Math.min(Math.max(0,a),1))<=i[0])return o[0];if(a>i[c])return o[c];for(var t=0;i[t]<a;)t++;var e=i[t-1],u=i[t]-e,s=(a-e)/u,d=h[t];void 0!==d&&("number"==typeof d&&(d=Ra((d-e)/u)),s=d(s));var p=(t-1+s)/c;return n.channels.reduce((function(a,r){var t=l[r](p);return void 0!==t&&(a[r]=t),a}),{mode:r})}},a.interpolateAlpha=k,a.interpolateCosine=function(a,r){return void 0===a&&(a=w),void 0===r&&(r=1),function(t){var n=(a||w)(n);return function(t){var e=(t=Math.pow(t,r))*(n.length-1),o=Math.floor(e),i=n[o],h=n[o+1],u=e-o,l=a([i,h],u);if("object"==typeof l){i=l[0],h=l[1];var c=(1-Math.cos(u*Math.PI))/2;return i*(1-c)+h*c}return l}}},a.interpolateHue=A,a.interpolateLinear=y,a.interpolateSplineBasis=$a,a.interpolateSplineMonotone=function(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return function(a){a=Math.pow(a,t);var n,o=e.length-1;switch(1===a?(n=o-1,a=1):n=Math.floor(a*o),r){case"default":return Sa(n>0?e[n-1]:2*e[n]-e[n+1],e[n],e[n+1],n<o-1?e[n+2]:2*e[n+1]-e[n],1/o,a-n/o);case"closed":return Sa(e[(n-1+e.length)%e.length],e[n],e[(n+1)%e.length],e[(n+2)%e.length],1/o,a-n/o);case"open":throw new Error("open monotone spline not implemented yet")}}}},a.interpolateSplineNatural=function(a,r,t){return void 0===a&&(a=w),void 0===r&&(r="default"),void 0===t&&(t=1),function(n){var e=(a||w)(n);return $a(w,r,t)(function(a){var r,t=a.length-1,n=new Array(t),e=new Array(t),o=new Array(t);for(n[1]=1/4,e[1]=(6*a[1]-a[0])/4,r=2;r<t;++r)n[r]=1/(4-n[r-1]),e[r]=(6*a[r]-(r==t-1?a[t]:0)-e[r-1])*n[r];for(o[0]=a[0],o[t]=a[t],t-1>0&&(o[t-1]=e[t-1]),r=t-2;r>0;--r)o[r]=e[r]-n[r]*o[r+1];return o}(e))}},a.lab=nr,a.lch=er,a.lrgb=Ya,a.nearest=function(a,r,t){void 0===r&&(r=Fa()),void 0===t&&(t=Ka);var n=a.map((function(a,r){return{color:t(a),i:r}}));return function(t,e,o){return void 0===e&&(e=1),void 0===o&&(o=1/0),isFinite(e)&&(e=Math.max(1,Math.min(e,n.length-1))),n.forEach((function(a){a.d=r(t,a.color)})),n.sort((function(a,r){return a.d-r.d})).slice(0,e).filter((function(a){return a.d<o})).map((function(r){return a[r.i]}))}},a.parse=ma,a.random=function(a,r){void 0===a&&(a="rgb"),void 0===r&&(r={});var t=Ma(a),n=function(a){return Object.keys(a).reduce((function(r,t){var n=a[t];return r[t]=Array.isArray(n)?n:[n,n],r}),{})}(r);return t.channels.reduce((function(a,r){return(n.alpha||"alpha"!==r)&&(a[r]=function(a){var r=a[0],t=a[1];return r+Math.random()*(t-r)}(n[r]||t.ranges[r])),a}),{mode:a})},a.rgb=Xa,a.round=ka,a.samples=function(a,r){if(void 0===a&&(a=2),void 0===r&&(r=1),a<2)return a<1?[]:[Math.pow(.5,r)];for(var t=[],n=0;n<a;n++)t.push(Math.pow(n/(a-1),r));return t},a.wcagContrast=function(a,r){var t=Ga(a),n=Ga(r);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)},a.wcagLuminance=Ga,a.yiq=ur,Object.defineProperty(a,"__esModule",{value:!0})}));
{
"name": "culori",
"version": "0.11.0",
"version": "0.11.1",
"main": "build/culori.umd.js",

@@ -5,0 +5,0 @@ "browser": "build/culori.umd.js",

Sorry, the diff of this file is too big to display

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