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.2 to 0.12.0

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=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*c)/i*u+(3*c-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})}));
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r=r||self).culori={})}(this,(function(r){"use strict";function n(r,n){if("number"==typeof r)return 3===n?{mode:"rgb",r:(r>>8&15|r>>4&240)/255,g:(r>>4&15|240&r)/255,b:(15&r|r<<4&240)/255}:4===n?{mode:"rgb",r:(r>>12&15|r>>8&240)/255,g:(r>>8&15|r>>4&240)/255,b:(r>>4&15|240&r)/255,alpha:(15&r|r<<4&240)/255}:6===n?{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}:8===n?{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(255&r)/255}:void 0}var a={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 t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o=t+"%?",i="(?:"+t+"%|"+t+")",u="(?:"+t+"(deg|grad|rad|turn)|"+t+")",h="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+h+t+h+t+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+e+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),s=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),d=new RegExp("^hsla?\\(\\s*"+u+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),g=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,b=new RegExp("^hwb\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+o+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+o+l+t+l+u+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$");function w(r){return r}function y(r,n,a){return r+a*(n-r)}function x(r){return void 0===r&&(r=1),1===r?w:function(n){return Math.pow(n,r)}}var k=function(r){return function(n){var a=function(r){for(var n=[],a=0;a<r.length-1;a++){var t=r[a],e=r[a+1];void 0===t&&void 0===e?n.push(void 0):void 0!==t&&void 0!==e?n.push([t,e]):n.push(void 0!==t?[t,t]:[e,e])}return n}(n);return function(n){var t=n*a.length,e=1===n?a.length-1:Math.floor(t),o=a[e];return void 0===o?void 0:r(o[0],o[1],t-e)}}},q=k(y),P=function(r){var n=!1,a=r.map((function(r){return void 0!==r?(n=!0,r):1}));return n?a:r},I={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(r){var a;return(a=r.match(g))?n(parseInt(a[1],16),a[1].length):void 0},function(r){var n,a;if(n=r.match(c)||r.match(s))a={mode:"rgb",r:n[1]/255,g:n[2]/255,b:n[3]/255};else{if(!(n=r.match(p)||r.match(f)))return;a={mode:"rgb",r:n[1]/100,g:n[2]/100,b:n[3]/100}}return void 0!==n[4]?a.alpha=n[4]/100:void 0!==n[5]&&(a.alpha=+n[5]),a},function(r){return"string"==typeof r&&n(a[r.toLowerCase()],6)||void 0},function(r){return"transparent"===r?n(0,8):void 0}],interpolate:{r:q,g:q,b:q,alpha:{use:q,fixup:P}}},E=function(r){return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)};function S(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o={mode:"lrgb",r:E(n),g:E(a),b:E(t)};return void 0!==e&&(o.alpha=e),o}var A=function(r){return r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r};function R(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o={mode:"rgb",r:A(n),g:A(a),b:A(t)};return void 0!==e&&(o.alpha=e),o}var C={mode:"lrgb",output:{rgb:R},input:{rgb:S},channels:["r","g","b","alpha"],interpolate:{r:q,g:q,b:q,alpha:{use:q,fixup:P}}};function N(r){return(r%=360)<0?r+360:r}var $=function(r,n){switch(n){case"deg":return+r;case"rad":return r/Math.PI*180;case"grad":return r/10*9;case"turn":return 360*r}};var j=function(r,n){return r.map((function(a,t,e){if(void 0===a)return a;var o=N(a);return 0===t||void 0===r[t-1]?o:n(o-N(e[t-1]))})).reduce((function(r,n){return r.length&&void 0!==n&&void 0!==r[r.length-1]?(r.push(n+r[r.length-1]),r):(r.push(n),r)}),[])},O=function(r){return j(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},H={mode:"hsl",output:{rgb:function(r){var n=r.h,a=r.s,t=r.l,e=r.alpha;n=N(n);var o,i=t+a*(t<.5?t:1-t),u=i-2*(i-t)*Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:i,g:u,b:2*t-i};break;case 1:o={r:u,g:i,b:2*t-i};break;case 2:o={r:2*t-i,g:i,b:u};break;case 3:o={r:2*t-i,g:u,b:i};break;case 4:o={r:u,g:2*t-i,b:i};break;case 5:o={r:i,g:2*t-i,b:u};break;default:o={r:2*t-i,g:2*t-i,b:2*t-i}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(d)||r.match(v);if(n){var a={mode:"hsl",h:void 0===n[3]?$(n[1],n[2]):+n[3],s:Math.min(Math.max(0,n[4]/100),1),l:Math.min(Math.max(0,n[5]/100),1)};return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=n[7]/255),a}}}],interpolate:{h:{use:q,fixup:O},s:q,l:q,alpha:{use:q,fixup:P}}};function z(r){var n=r.h,a=r.s,t=r.v,e=r.alpha;n=N(n);var o,i=Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:t,g:t*(1-a*i),b:t*(1-a)};break;case 1:o={r:t*(1-a*i),g:t,b:t*(1-a)};break;case 2:o={r:t*(1-a),g:t,b:t*(1-a*i)};break;case 3:o={r:t*(1-a),g:t*(1-a*i),b:t};break;case 4:o={r:t*(1-a*i),g:t*(1-a),b:t};break;case 5:o={r:t,g:t*(1-a),b:t*(1-a*i)};break;default:o={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}function D(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}var L={mode:"hsv",output:{rgb:z},input:{rgb:D},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:q,fixup:O},s:q,v:q,alpha:{use:q,fixup:P}}};var B={mode:"hsi",output:{rgb:function(r){var n=r.h,a=r.s,t=r.i,e=r.alpha;n=N(n);var o,i=Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:t*(1+a*(3/(2-i)-1)),g:t*(1+a*(3*(1-i)/(2-i)-1)),b:t*(1-a)};break;case 1:o={r:t*(1+a*(3*(1-i)/(2-i)-1)),g:t*(1+a*(3/(2-i)-1)),b:t*(1-a)};break;case 2:o={r:t*(1-a),g:t*(1+a*(3/(2-i)-1)),b:t*(1+a*(3*(1-i)/(2-i)-1))};break;case 3:o={r:t*(1-a),g:t*(1+a*(3*(1-i)/(2-i)-1)),b:t*(1+a*(3/(2-i)-1))};break;case 4:o={r:t*(1+a*(3*(1-i)/(2-i)-1)),g:t*(1-a),b:t*(1+a*(3/(2-i)-1))};break;case 5:o={r:t*(1+a*(3/(2-i)-1)),g:t*(1-a),b:t*(1+a*(3*(1-i)/(2-i)-1))};break;default:o={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsi",s:n+a+t===0?0:1-3*i/(n+a+t),i:(n+a+t)/3};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:q,fixup:O},s:q,i:q,alpha:{use:q,fixup:P}}};var W={mode:"hwb",output:{rgb:function(r){var n=r.h,a=r.w,t=r.b;if(a+t>1){var e=a+t;a/=e,t/=e}return z({h:n,s:1===t?1:1-a/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var n=D(r);if(void 0!==n){var a={mode:"hwb",w:(1-n.s)*n.v,b:1-n.v};return void 0!==n.h&&(a.h=n.h),void 0!==n.alpha&&(a.alpha=n.alpha),a}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(b);if(n){var a={mode:"hwb",h:void 0===n[3]?$(n[1],n[2]):+n[3],w:n[4]/100,b:n[5]/100};if(a.w+a.b>1){var t=a.w+a.b;a.w/=t,a.b/=t}return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=n[7]/255),a}}}],interpolate:{h:{use:q,fixup:O},w:q,b:q,alpha:{use:q,fixup:P}}},_=Math.pow(29,3)/Math.pow(3,3),F=Math.pow(6,3)/Math.pow(29,3),G=function(r){return Math.pow(r,3)>F?Math.pow(r,3):(116*r-16)/_};function K(r){var n,a,t,e,o,i=function(r){var n=r.x,a=r.y,t=r.z;return R({r:3.1338561*n-1.6168667*a-.4906146*t,g:-.9787684*n+1.9161415*a+.033454*t,b:.0719453*n-.2289914*a+1.4052427*t})}((a=(n=r).l,t=n.a,o=(e=(a+16)/116)-n.b/200,{x:.96422*G(t/500+e),y:1*G(e),z:.82521*G(o)}));return i.mode="rgb",void 0!==r.alpha&&(i.alpha=r.alpha),i}var T=function(r){return r>F?Math.cbrt(r):(_*r+16)/116};function J(r){var n=function(r){var n=r.x,a=r.y,t=r.z,e=T(n/.96422),o=T(a/1);return{mode:"lab",l:116*o-16,a:500*(e-o),b:200*(o-T(t/.82521))}}(function(r){var n=S(r),a=n.r,t=n.g,e=n.b;return{x:.4360747*a+.3850649*t+.1430804*e,y:.2225045*a+.7168786*t+.0606169*e,z:.0139322*a+.0971045*t+.7141733*e}}(r));return r.r===r.b===r.g&&(n.a=n.b=0),void 0!==r.alpha&&(n.alpha=r.alpha),n}var Q={mode:"lab",output:{rgb:K},input:{rgb:J},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.167,93.408],b:[-111.859,93.246]},parsers:[function(r){if("string"==typeof r){var n=r.match(M);if(n){var a={mode:"lab",l:+n[1],a:+n[2],b:+n[3]};return void 0!==n[4]?a.alpha=n[4]/100:void 0!==n[5]&&(a.alpha=+n[5]),a}}}],interpolate:{l:q,a:q,b:q,alpha:{use:q,fixup:P}}};function U(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"lch",l:n,c:o};return o&&(i.h=N(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i}function V(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"lab",l:n,a:a?a*Math.cos(t/180*Math.PI):0,b:a?a*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o}var X={mode:"lch",output:{lab:V,rgb:function(r){return K(V(r))}},input:{rgb:function(r){return U(J(r))},lch:U},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(m);if(n){var a={mode:"lch",l:+n[1],c:Math.max(0,+n[2]),h:void 0===n[5]?$(n[3],n[4]):+n[5]};return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=+n[7]),a}}}],interpolate:{h:{use:q,fixup:O},c:q,l:q,alpha:{use:q,fixup:P}}},Y=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Z=Math.PI/180,rr=180/Math.PI,nr=Y[3]*Y[4],ar=Y[1]*Y[4],tr=Y[1]*Y[2]-Y[0]*Y[3];var er={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=(tr*t+n*nr-a*ar)/(tr+nr-ar),i=t-o,u=(Y[4]*(a-o)-Y[2]*i)/Y[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(Y[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*rr-120),void 0!==e&&(h.alpha=e),h}},output:{rgb:function(r){var n=r.h,a=r.s,t=r.l,e=r.alpha,o={mode:"rgb"};n=(void 0===n?0:n+120)*Z;var i=void 0===a?0:a*t*(1-t),u=Math.cos(n),h=Math.sin(n);return o.r=t+i*(Y[0]*u+Y[1]*h),o.g=t+i*(Y[2]*u+Y[3]*h),o.b=t+i*(Y[4]*u+Y[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:q,fixup:O},s:q,l:q,alpha:{use:q,fixup:P}}};function or(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"dlch",l:n,c:o};return o&&(i.h=N(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i}var ir=26/180*Math.PI,ur=Math.cos(ir),hr=Math.sin(ir),lr=100/Math.log(1.39);function cr(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"lab",l:(Math.exp(1*n/lr)-1)/.0039};if(void 0===t)o.a=o.b=0;else{var i=(Math.exp(.0435*a*1*1)-1)/.075,u=i*Math.cos(t/180*Math.PI-ir),h=i*Math.sin(t/180*Math.PI-ir);o.a=u*ur-h/.83*hr,o.b=u*hr+h/.83*ur}return void 0!==e&&(o.alpha=e),o}function pr(r){return cr(or(r))}function sr(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=a*ur+t*hr,i=.83*(t*ur-a*hr),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:lr/1*Math.log(1+.0039*n),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=(Math.atan2(i,o)+ir)/Math.PI*180),void 0!==e&&(h.alpha=e),h}function fr(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"dlab",l:n,a:0===a?0:a*Math.cos(t/180*Math.PI),b:0===a?0:a*Math.sin(t/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}function dr(r){return fr(sr(r))}var vr={mode:"dlab",output:{lab:pr,rgb:function(r){return K(pr(r))}},input:{lab:dr,rgb:function(r){return dr(J(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-39.229,45.166],b:[-43.002,44.424]},interpolate:{l:q,a:q,b:q,alpha:{use:q,fixup:P}}};var gr={mode:"dlch",output:{lab:cr,dlab:fr,rgb:function(r){return K(cr(r))}},input:{lab:sr,dlab:or,rgb:function(r){return sr(J(r))}},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,50.944],h:[0,360]},interpolate:{l:q,c:q,h:{use:q,fixup:O},alpha:{use:q,fixup:P}}};var br={mode:"yiq",output:{rgb:function(r){var n=r.y,a=r.i,t=r.q;return R({r:n+.95608445*a+.6208885*t,g:n-.27137664*a-.6486059*t,b:n-1.10561724*a+1.70250126*t,alpha:r.alpha})}},input:{rgb:function(r){var n=S(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"yiq",y:.29889531*a+.58662247*t+.11448223*e,i:.59597799*a-.2741761*t-.32180189*e,q:.21147017*a-.52261711*t+.31114694*e};return void 0!==o&&(i.alpha=o),i}},channels:["y","i","q","alpha"],ranges:{i:[-.593,.593],q:[-.52,.52]},interpolate:{y:q,i:q,q:q,alpha:{use:q,fixup:P}}},Mr={},mr={},wr=[],yr=function(r){Mr[r.mode]=Object.assign(Mr[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(n){Mr[n]||(Mr[n]={}),Mr[n][r.mode]=r.input[n]})),r.ranges||(r.ranges={}),r.channels.forEach((function(n){if(void 0===r.ranges[n]&&(r.ranges[n]=[0,1]),!r.interpolate[n])throw new Error("Missing interpolator for: "+n);"function"==typeof r.interpolate[n]&&(r.interpolate[n]={use:r.interpolate[n]}),r.interpolate[n].fixup||(r.interpolate[n].fixup=w)})),mr[r.mode]=r,(r.parsers||[]).forEach((function(r){return wr.push(r)}))},xr=function(r){return mr[r]},kr=function(r){for(var n,a=0,t=wr.length;a<t&&void 0===(n=wr[a++](r)););return n};function qr(r,n){return void 0===r?void 0:"object"!=typeof r?kr(r):void 0!==r.mode?r:n?Object.assign({},r,{mode:n}):void 0}var Pr=function(r){return void 0===r&&(r="rgb"),function(n){return void 0!==(n=qr(n,r))?n.mode===r?n:Mr[n.mode][r]?Mr[n.mode][r](n):"rgb"===r?Mr[n.mode].rgb(n):Mr.rgb[r](Mr[n.mode].rgb(n)):void 0}};function Ir(r){return void 0===r&&(r=4),function(n){return"number"==typeof n?function(r,n){return Math.round(r*(n=Math.pow(10,n)))/n}(n,r):n}}function Er(r){return Math.round(255*Math.max(0,Math.min(r,1)))}var Sr=Pr("rgb"),Ar=Ir(2),Rr=function(r){var n=Sr(r);if(void 0!==n)return"#"+(1<<24|Er(n.r)<<16|Er(n.g)<<8|Er(n.b)).toString(16).slice(1)},Cr=function(r){var n=Sr(r);if(void 0!==n){var a=Er(n.r),t=Er(n.g),e=Er(n.b);return void 0===n.alpha||1===n.alpha?"rgb("+a+", "+t+", "+e+")":"rgba("+a+", "+t+", "+e+", "+Ar(n.alpha)+")"}};function Nr(r){return void 0===r&&(r=.5),function(n){return r<=0?1:r>=1?0:Math.pow(n,Math.log(.5)/Math.log(r))}}var $r=function(r,n){void 0===n&&(n="rgb");var a=n?xr(n).channels:null,t=n?Pr(n):qr;return function(e){var o=t(e);return(a||xr(e.mode).channels).reduce((function(a,t){var e=r(o[t],t,o,n);return void 0===e||isNaN(e)||(a[t]=e),a}),{mode:n})}},jr=function(r,n,a){return"alpha"!==n?(r||0)*(void 0!==a.alpha?a.alpha:1):r},Or=function(r,n,a){return"alpha"!==n&&0!==a.alpha?(r||0)/(void 0!==a.alpha?a.alpha:1):r},Hr=function(r){return"function"==typeof r},zr=function(r){return r&&"object"==typeof r},Dr=function(r){return"number"==typeof r},Lr=function(r,n,a,t){void 0===n&&(n="rgb");var e=xr(n),o=Pr(n),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):Dr(r)||Hr(r)?h[u.length]=r:(i.push(o(r)),u.push(void 0))})),function(r){void 0===r[0]&&(r[0]=0),void 0===r[r.length-1]&&(r[r.length-1]=1);for(var n,a,t,e,o=1;o<r.length;){if(void 0===r[o]){for(a=o,t=r[o-1],n=o;void 0===r[n];)n++;for(e=(r[n]-t)/(n-o+1);o<n;)r[o]=t+(o+1-a)*e,o++}else r[o]<r[o-1]&&(r[o]=r[o-1]);o++}}(u);var l=e.channels.reduce((function(r,n){var t;return t=zr(a)&&zr(a[n])&&a[n].fixup?a[n].fixup:zr(e.interpolate[n])&&e.interpolate[n].fixup?e.interpolate[n].fixup:w,r[n]=t(i.map((function(r){return r[n]}))),r}),{});if(t){var c=i.map((function(r,a){return e.channels.reduce((function(r,n){return r[n]=l[n][a],r}),{mode:n})}));l=e.channels.reduce((function(r,a){return r[a]=c.map((function(r){var e=t(r[a],a,r,n);return isNaN(e)?void 0:e})),r}),{})}var p=e.channels.reduce((function(r,n){var t;return Hr(a)?t=a:zr(a)&&Hr(a[n])?t=a[n]:zr(a)&&zr(a[n])&&a[n].use?t=a[n].use:Hr(e.interpolate[n])?t=e.interpolate[n]:zr(e.interpolate[n])&&(t=e.interpolate[n].use),r[n]=t(l[n]),r}),{}),s=i.length-1;return function(r){if((r=Math.min(Math.max(0,r),1))<=u[0])return i[0];if(r>u[s])return i[s];for(var a=0;u[a]<r;)a++;var t=u[a-1],o=u[a]-t,l=(r-t)/o,c=h[a]||h[0];void 0!==c&&(Dr(c)&&(c=Nr((c-t)/o)),l=c(l));var f=(a-1+l)/s;return e.channels.reduce((function(r,n){var a=p[n](f);return void 0!==a&&(r[n]=a),r}),{mode:n})}},Br=function(r,n){return function(a,t,e){void 0===t&&(t="rgb");var o=n?$r(n,t):void 0,i=Lr(a,t,e,r);return o?function(r){return o(i(r))}:i}},Wr=Br(jr,Or);function _r(r){return(1-Math.cos(r*Math.PI))/2}var Fr=function(r,n,a,t,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*r+(4-6*o+3*i)*n+(1+3*e+3*o-3*i)*a+i*t)/6},Gr=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return Fr(t>0?r[t-1]:2*r[t]-r[t+1],r[t],r[t+1],t<a-1?r[t+2]:2*r[t+1]-r[t],(n-t/a)*a)}},Kr=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return Fr(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(n-t/a)*a)}},Tr=function(r){return function(r){throw new Error("open basis spline is not yet implemented")}},Jr=function(r){var n,a=r.length-1,t=new Array(a),e=new Array(a),o=new Array(a);for(t[1]=1/4,e[1]=(6*r[1]-r[0])/4,n=2;n<a;++n)t[n]=1/(4-t[n-1]),e[n]=(6*r[n]-(n==a-1?r[a]:0)-e[n-1])*t[n];for(o[0]=r[0],o[a]=r[a],a-1>0&&(o[a-1]=e[a-1]),n=a-2;n>0;--n)o[n]=e[n]-t[n]*o[n+1];return o},Qr=function(r){return Gr(Jr(r))},Ur=function(r){return Kr(Jr(r))},Vr=function(r){return Tr(Jr(r))},Xr=Math.sign,Yr=Math.min,Zr=Math.abs,rn=function(r,n,a,t,e,o){var i=e*e,u=o*o,h=u*o,l=(a-n)/e,c=(n-r)/e,p=(a-r)/(2*e),s=(Xr(c)+Xr(l))*Yr(Zr(c),Zr(l),.5*Zr(p)),f=(t-a)/e,d=(t-n)/(2*e),v=(Xr(l)+Xr(f))*Yr(Zr(l),Zr(f),.5*Zr(d));return(s+v-2*l)/i*h+(3*l-2*s-v)/e*u+s*o+n},nn=function(r){return function(n){var a,t=r.length-1;return 1===n?(a=t-1,n=1):a=Math.floor(n*t),rn(a>0?r[a-1]:2*r[a]-r[a+1],r[a],r[a+1],a<t-1?r[a+2]:2*r[a+1]-r[a],1/t,n-a/t)}},an=function(r){return function(n){var a,t=r.length-1;return 1===n?(a=t-1,n=1):a=Math.floor(n*t),rn(r[(a-1+r.length)%r.length],r[a],r[(a+1)%r.length],r[(a+2)%r.length],1/t,n-a/t)}},tn=function(r){return function(n){var a,t=r.length-1;return 1===n?(a=t-1,n=1):a=Math.floor(n*t),rn(r[(a-1+r.length)%r.length],r[a],r[(a+1)%r.length],r[(a+2)%r.length],1/t,n-a/t)}};var en=Pr("rgb");function on(r){var n=en(r);return void 0!==n&&n.r>=0&&n.r<=1&&n.g>=0&&n.g<=1&&n.b>=0&&n.b<=1}var un=Pr("lch"),hn=Pr("rgb"),ln=function(r){var n=hn(r);return n.r=Math.max(0,Math.min(n.r,1)),n.g=Math.max(0,Math.min(n.g,1)),n.b=Math.max(0,Math.min(n.b,1)),n},cn=function(r){return void 0===(r=qr(r))||on(r)?r:Pr(r.mode)(ln(r))},pn=function(r){if(void 0===(r=qr(r))||on(r))return r;var n=Pr(r.mode);r=un(r);var a=Object.assign({},r,{c:0});if(!on(a))return n(ln(r));for(var t=0,e=r.c;e-t>.01;)a.c=t+.5*(e-t),on(a)?t=a.c:e=a.c;return n(a)},sn=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n=[1,1,1,0]);var a=xr(r).channels,t=Pr(r);return function(r,e){var o=t(r),i=t(e);return Math.sqrt(a.reduce((function(r,a,t){var e,u,h,l,c="h"===a?(e=o[a],u=i[a],h=N(e),l=N(u),Math.abs(l-h)>180?h-(l-360*Math.sign(l-h)):h-l):o[a]-i[a];return r+(n[t]||0)*Math.pow(isNaN(c)?0:c,2)}),0))}},fn=function(r){return r};var dn={normal:function(r,n){return n},multiply:function(r,n){return r*n},screen:function(r,n){return r+n-r*n},"hard-light":function(r,n){return n<.5?2*r*n:2*n*(1-r)-1},overlay:function(r,n){return r<.5?2*n*r:2*r*(1-n)-1},darken:function(r,n){return Math.min(r,n)},lighten:function(r,n){return Math.max(r,n)},"color-dodge":function(r,n){return 0===r?0:1===n?1:Math.min(1,r/(1-n))},"color-burn":function(r,n){return 1===r?1:0===n?0:1-Math.min(1,(1-r)/n)},"soft-light":function(r,n){return n<.5?r-(1-2*n)*r*(1-r):r+(2*n-1)*((r<.25?((16*r-12)*r+4)*r:Math.sqrt(r))-r)},difference:function(r,n){return Math.abs(r-n)},exclusion:function(r,n){return r+n-2*r*n}};function vn(r){var n=Pr("lrgb")(r);return.2126*n.r+.7152*n.g+.0722*n.b}var gn=Pr("rgb"),bn=[[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]],Mn=[[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]],mn=[[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]],wn=function(r,n){var a=Math.max(0,Math.min(1,n)),t=Math.round(a/.1),e=Math.round(a%.1),o=r[t];if(e>0&&t<r.length-1){var i=r[t+1];o=o.map((function(r,n){return y(o[n],i[n],e)}))}return function(r){var n=qr(r);if(void 0!==n){var a=gn(n),t=a.r,e=a.g,i=a.b,u={mode:"rgb",r:o[0]*t+o[1]*e+o[2]*i,g:o[3]*t+o[4]*e+o[5]*i,b:o[6]*t+o[7]*e+o[8]*i};return void 0!==n.alpha&&(u.alpha=n.alpha),Pr(n.mode)(u)}}};yr(I),yr(C),yr(H),yr(L),yr(B),yr(W),yr(Q),yr(X),yr(er),yr(vr),yr(gr),yr(br);var yn=Pr("rgb"),xn=Pr("lrgb"),kn=Pr("hsl"),qn=Pr("hsv"),Pn=Pr("hsi"),In=Pr("hwb"),En=Pr("lab"),Sn=Pr("lch"),An=Pr("cubehelix"),Rn=Pr("dlab"),Cn=Pr("dlch"),Nn=Pr("yiq");r.blend=function(r,n,a){void 0===n&&(n="normal"),void 0===a&&(a="rgb");var t="function"==typeof n?n:dn[n],e=Pr(a),o=xr(a).channels;return r.map((function(r){var n=e(r);return void 0===n.alpha&&(n.alpha=1),n})).reduce((function(r,n){if(void 0===r)return n;var e=n.alpha+r.alpha*(1-n.alpha);return o.reduce((function(a,o){return"alpha"!==o&&(0===e?a[o]=0:(a[o]=n.alpha*(1-r.alpha)*n[o]+n.alpha*r.alpha*t(r[o],n[o])+(1-n.alpha)*r.alpha*r[o],a[o]=Math.max(0,Math.min(1,a[o]/e)))),a}),{mode:a,alpha:e})}))},r.clamp=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return cn;case"lch":return pn}},r.clampChroma=pn,r.clampRgb=cn,r.colorsNamed=a,r.converter=Pr,r.cubehelix=An,r.deficiencyDeuter=function(r){return void 0===r&&(r=1),wn(Mn,r)},r.deficiencyProt=function(r){return void 0===r&&(r=1),wn(bn,r)},r.deficiencyTrit=function(r){return void 0===r&&(r=1),wn(mn,r)},r.defineMode=yr,r.differenceCie76=function(){return sn("lab")},r.differenceCie94=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=.045),void 0===a&&(a=.015);var t=Pr("lab");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,p=Math.sqrt(l*l+c*c),s=u.l,f=u.a,d=u.b,v=Math.sqrt(f*f+d*d),g=Math.pow(h-s,2),b=Math.pow(p-v,2),M=Math.pow(l-f,2)+Math.pow(c-d,2)-b;return Math.sqrt(g/Math.pow(r,2)+b/Math.pow(1+n*p,2)+M/Math.pow(1+a*p,2))}},r.differenceCiede2000=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=1);var t=Pr("lab");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,p=Math.sqrt(l*l+c*c),s=u.l,f=u.a,d=u.b,v=(p+Math.sqrt(f*f+d*d))/2,g=.5*(1-Math.sqrt(Math.pow(v,7)/(Math.pow(v,7)+Math.pow(25,7)))),b=l*(1+g),M=f*(1+g),m=Math.sqrt(b*b+c*c),w=Math.sqrt(M*M+d*d),y=Math.abs(b)+Math.abs(c)===0?0:Math.atan2(c,b);y+=2*(y<0)*Math.PI;var x=Math.abs(M)+Math.abs(d)===0?0:Math.atan2(d,M);x+=2*(x<0)*Math.PI;var k=s-h,q=w-m,P=m*w==0?0:x-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),S=(h+s)/2,A=(m+w)/2;m*w==0?I=y+x:(I=(y+x)/2,I-=(Math.abs(y-x)>Math.PI)*Math.PI,I+=2*(I<0)*Math.PI);var R=Math.pow(S-50,2),C=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),N=1+.015*R/Math.sqrt(20+R),$=1+.045*A,j=1+.015*A*C,O=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),H=2*Math.sqrt(Math.pow(A,7)/(Math.pow(A,7)+Math.pow(25,7))),z=-1*Math.sin(2*O)*H;return Math.sqrt(Math.pow(k/(r*N),2)+Math.pow(q/(n*$),2)+Math.pow(E/(a*j),2)+z*q/(n*$)*E/(a*j))}},r.differenceCmc=function(r,n){void 0===r&&(r=1),void 0===n&&(n=1);var a=Pr("lab");return function(t,e){var o=a(t),i=o.l,u=o.a,h=o.b,l=Math.sqrt(u*u+h*h),c=Math.atan2(h,u);c+=2*Math.PI*(c<0);var p=a(e),s=p.l,f=p.a,d=p.b,v=Math.sqrt(f*f+d*d),g=Math.pow(i-s,2),b=Math.pow(l-v,2),M=Math.pow(u-f,2)+Math.pow(h-d,2)-b,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,x=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(g/Math.pow(r*w,2)+b/Math.pow(n*y,2)+M/Math.pow(x,2))}},r.differenceDin99o=function(){return sn("dlab")},r.differenceEuclidean=sn,r.differenceKotsarenkoRamos=function(){return sn("yiq",[.5053,.299,.1957])},r.displayable=on,r.dlab=Rn,r.dlch=Cn,r.easingGamma=x,r.easingInOutSine=_r,r.easingMidpoint=Nr,r.easingSmootherstep=function(r){return r*r*r*(r*(6*r-15)+10)},r.easingSmoothstep=function(r){return r*r*(3-2*r)},r.fixupAlpha=P,r.fixupHueDecreasing=function(r){return j(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return j(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return j(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=O,r.formatHex=Rr,r.formatHex8=function(r){var n=Sr(r);if(void 0!==n){var a=Er(void 0!==n.alpha?n.alpha:1);return Rr(n)+(256|a).toString(16).slice(1)}},r.formatRgb=Cr,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return Cr;case"hex":return Rr}},r.getModeDefinition=xr,r.hsi=Pn,r.hsl=kn,r.hsv=qn,r.hwb=In,r.interpolate=function(r,n,a){return void 0===n&&(n="rgb"),Lr(r,n,a)},r.interpolateAlpha=P,r.interpolateCosine=function(r,n){return void 0===n&&(n=1),function(a){var t=x(n),e=k((function(r,n,a){return y(r,n,_r(a))}))((r||w)(a));return function(r){return e(t(r))}}},r.interpolateHue=O,r.interpolateLinear=function(r,n){return void 0===n&&(n=1),function(a){var t=x(n);return function(n){return q((r||w)(a))(t(n))}}},r.interpolateSplineBasis=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"default"===n?function(n){return Gr((r||w)(t))(e(n))}:"closed"===n?function(n){return Kr((r||w)(t))(e(n))}:"open"===n?function(n){return Tr((r||w)(t))(e(n))}:void 0}},r.interpolateSplineMonotone=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"closed"===n?function(n){return an((r||w)(t))(e(n))}:"open"===n?function(n){return tn((r||w)(t))(e(n))}:"default"===n?function(n){return nn((r||w)(t))(e(n))}:void 0}},r.interpolateSplineNatural=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"default"===n?function(n){return Qr((r||w)(t))(e(n))}:"closed"===n?function(n){return Ur((r||w)(t))(e(n))}:"open"===n?function(n){return Vr((r||w)(t))(e(n))}:void 0}},r.interpolateWith=Br,r.interpolateWithPremultipliedAlpha=Wr,r.interpolatorLinear=q,r.interpolatorPiecewise=k,r.interpolatorSplineBasis=Gr,r.interpolatorSplineBasisClosed=Kr,r.interpolatorSplineBasisOpen=Tr,r.interpolatorSplineMonotone=nn,r.interpolatorSplineMonotoneClosed=an,r.interpolatorSplineMonotoneOpen=tn,r.interpolatorSplineNatural=Qr,r.interpolatorSplineNaturalClosed=Ur,r.interpolatorSplineNaturalOpen=Vr,r.lab=En,r.lch=Sn,r.lerp=y,r.lrgb=xn,r.mapAlphaDivide=Or,r.mapAlphaMultiply=jr,r.mapper=$r,r.nearest=function(r,n,a){void 0===n&&(n=sn()),void 0===a&&(a=fn);var t=r.map((function(r,n){return{color:a(r),i:n}}));return function(a,e,o){return void 0===e&&(e=1),void 0===o&&(o=1/0),isFinite(e)&&(e=Math.max(1,Math.min(e,t.length-1))),t.forEach((function(r){r.d=n(a,r.color)})),t.sort((function(r,n){return r.d-n.d})).slice(0,e).filter((function(r){return r.d<o})).map((function(n){return r[n.i]}))}},r.parse=kr,r.random=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n={});var a=xr(r),t=function(r){return Object.keys(r).reduce((function(n,a){var t=r[a];return n[a]=Array.isArray(t)?t:[t,t],n}),{})}(n);return a.channels.reduce((function(r,n){return(t.alpha||"alpha"!==n)&&(r[n]=function(r){var n=r[0],a=r[1];return n+Math.random()*(a-n)}(t[n]||a.ranges[n])),r}),{mode:r})},r.rgb=yn,r.round=Ir,r.samples=function(r,n){void 0===r&&(r=2),void 0===n&&(n=1);var a=x(n);if(r<2)return r<1?[]:[a(.5)];for(var t=[],e=0;e<r;e++)t.push(a(e/(r-1)));return t},r.wcagContrast=function(r,n){var a=vn(r),t=vn(n);return(Math.max(a,t)+.05)/(Math.min(a,t)+.05)},r.wcagLuminance=vn,r.yiq=Nn,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "culori",
"version": "0.11.2",
"version": "0.12.0",
"main": "build/culori.umd.js",

@@ -39,3 +39,3 @@ "browser": "build/culori.umd.js",

"@rollup/plugin-buble": "^0.21.3",
"eslint": "^7.3.1",
"eslint": "^7.4.0",
"esm": "^3.2.25",

@@ -47,3 +47,3 @@ "gh-pages": "^3.1.0",

"pretty-quick": "^2.0.1",
"rollup": "^2.18.0",
"rollup": "^2.21.0",
"rollup-plugin-terser": "^6.1.0",

@@ -50,0 +50,0 @@ "tap-spec": "^5.0.0",

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