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.12.3 to 0.12.5

2

build/culori.umd.js

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

!function(r,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((r=r||self).culori={})}(this,(function(r){"use strict";function a(r,a){if("number"==typeof r)return 3===a?{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===a?{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===a?{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}:8===a?{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(255&r)/255}:void 0}var n={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,a,n){return r+n*(a-r)}function x(r){return void 0===r&&(r=1),1===r?w:function(a){return Math.pow(a,r)}}var k=function(r){return function(a){var n=function(r){for(var a=[],n=0;n<r.length-1;n++){var t=r[n],e=r[n+1];void 0===t&&void 0===e?a.push(void 0):void 0!==t&&void 0!==e?a.push([t,e]):a.push(void 0!==t?[t,t]:[e,e])}return a}(a);return function(a){var t=a*n.length,e=1===a?n.length-1:Math.floor(t),o=n[e];return void 0===o?void 0:r(o[0],o[1],t-e)}}},q=k(y),P=function(r){var a=!1,n=r.map((function(r){return void 0!==r?(a=!0,r):1}));return a?n:r},I={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(r){var n;return(n=r.match(g))?a(parseInt(n[1],16),n[1].length):void 0},function(r){var a,n;if(a=r.match(c)||r.match(s))n={mode:"rgb",r:a[1]/255,g:a[2]/255,b:a[3]/255};else{if(!(a=r.match(p)||r.match(f)))return;n={mode:"rgb",r:a[1]/100,g:a[2]/100,b:a[3]/100}}return void 0!==a[4]?n.alpha=a[4]/100:void 0!==a[5]&&(n.alpha=+a[5]),n},function(r){return"string"==typeof r&&a(n[r.toLowerCase()],6)||void 0},function(r){return"transparent"===r?a(0,8):void 0}],interpolate:{r:q,g:q,b:q,alpha:{use:q,fixup:P}}},z=function(r){return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)};function E(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o={mode:"lrgb",r:z(a),g:z(n),b:z(t)};return void 0!==e&&(o.alpha=e),o}var S=function(r){return r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r};function A(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o={mode:"rgb",r:S(a),g:S(n),b:S(t)};return void 0!==e&&(o.alpha=e),o}var R={mode:"lrgb",output:{rgb:A},input:{rgb:E},channels:["r","g","b","alpha"],interpolate:{r:q,g:q,b:q,alpha:{use:q,fixup:P}}};function C(r){return(r%=360)<0?r+360:r}var N=function(r,a){switch(a){case"deg":return+r;case"rad":return r/Math.PI*180;case"grad":return r/10*9;case"turn":return 360*r}};var $=function(r,a){return r.map((function(n,t,e){if(void 0===n)return n;var o=C(n);return 0===t||void 0===r[t-1]?o:a(o-C(e[t-1]))})).reduce((function(r,a){return r.length&&void 0!==a&&void 0!==r[r.length-1]?(r.push(a+r[r.length-1]),r):(r.push(a),r)}),[])},j=function(r){return $(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},O={mode:"hsl",output:{rgb:function(r){var a=r.h,n=r.s,t=r.l,e=r.alpha;a=C(a);var o,i=t+n*(t<.5?t:1-t),u=i-2*(i-t)*Math.abs(a/60%2-1);switch(Math.floor(a/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 a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.max(a,n,t),i=Math.min(a,n,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===a?(n-t)/(o-i)+6*(n<t):o===n?(t-a)/(o-i)+2:(a-n)/(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 a=r.match(d)||r.match(v);if(a){var n={mode:"hsl",h:void 0===a[3]?N(a[1],a[2]):+a[3],s:Math.min(Math.max(0,a[4]/100),1),l:Math.min(Math.max(0,a[5]/100),1)};return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=a[7]/255),n}}}],interpolate:{h:{use:q,fixup:j},s:q,l:q,alpha:{use:q,fixup:P}}};function H(r){var a=r.h,n=r.s,t=r.v,e=r.alpha;a=C(a);var o,i=Math.abs(a/60%2-1);switch(Math.floor(a/60)){case 0:o={r:t,g:t*(1-n*i),b:t*(1-n)};break;case 1:o={r:t*(1-n*i),g:t,b:t*(1-n)};break;case 2:o={r:t*(1-n),g:t,b:t*(1-n*i)};break;case 3:o={r:t*(1-n),g:t*(1-n*i),b:t};break;case 4:o={r:t*(1-n*i),g:t*(1-n),b:t};break;case 5:o={r:t,g:t*(1-n),b:t*(1-n*i)};break;default:o={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}function D(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.max(a,n,t),i=Math.min(a,n,t),u={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(u.h=60*(o===a?(n-t)/(o-i)+6*(n<t):o===n?(t-a)/(o-i)+2:(a-n)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}var L={mode:"hsv",output:{rgb:H},input:{rgb:D},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:q,fixup:j},s:q,v:q,alpha:{use:q,fixup:P}}};var B={mode:"hsi",output:{rgb:function(r){var a=r.h,n=r.s,t=r.i,e=r.alpha;a=C(a);var o,i=Math.abs(a/60%2-1);switch(Math.floor(a/60)){case 0:o={r:t*(1+n*(3/(2-i)-1)),g:t*(1+n*(3*(1-i)/(2-i)-1)),b:t*(1-n)};break;case 1:o={r:t*(1+n*(3*(1-i)/(2-i)-1)),g:t*(1+n*(3/(2-i)-1)),b:t*(1-n)};break;case 2:o={r:t*(1-n),g:t*(1+n*(3/(2-i)-1)),b:t*(1+n*(3*(1-i)/(2-i)-1))};break;case 3:o={r:t*(1-n),g:t*(1+n*(3*(1-i)/(2-i)-1)),b:t*(1+n*(3/(2-i)-1))};break;case 4:o={r:t*(1+n*(3*(1-i)/(2-i)-1)),g:t*(1-n),b:t*(1+n*(3/(2-i)-1))};break;case 5:o={r:t*(1+n*(3/(2-i)-1)),g:t*(1-n),b:t*(1+n*(3*(1-i)/(2-i)-1))};break;default:o={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.max(a,n,t),i=Math.min(a,n,t),u={mode:"hsi",s:a+n+t===0?0:1-3*i/(a+n+t),i:(a+n+t)/3};return o-i!=0&&(u.h=60*(o===a?(n-t)/(o-i)+6*(n<t):o===n?(t-a)/(o-i)+2:(a-n)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:q,fixup:j},s:q,i:q,alpha:{use:q,fixup:P}}};var F={mode:"hwb",output:{rgb:function(r){var a=r.h,n=r.w,t=r.b;if(n+t>1){var e=n+t;n/=e,t/=e}return H({h:a,s:1===t?1:1-n/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var a=D(r);if(void 0!==a){var n={mode:"hwb",w:(1-a.s)*a.v,b:1-a.v};return void 0!==a.h&&(n.h=a.h),void 0!==a.alpha&&(n.alpha=a.alpha),n}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var a=r.match(b);if(a){var n={mode:"hwb",h:void 0===a[3]?N(a[1],a[2]):+a[3],w:a[4]/100,b:a[5]/100};if(n.w+n.b>1){var t=n.w+n.b;n.w/=t,n.b/=t}return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=a[7]/255),n}}}],interpolate:{h:{use:q,fixup:j},w:q,b:q,alpha:{use:q,fixup:P}}},W=.96422,_=.82521,G=Math.pow(29,3)/Math.pow(3,3),K=Math.pow(6,3)/Math.pow(29,3),T=function(r){return Math.pow(r,3)>K?Math.pow(r,3):(116*r-16)/G};function J(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=(a+16)/116,i=o-t/200,u={mode:"xyz",x:T(n/500+o)*W,y:1*T(o),z:T(i)*_};return void 0!==e&&(u.alpha=e),u}function Q(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=A({r:3.1338561*a-1.6168667*n-.4906146*t,g:-.9787684*a+1.9161415*n+.033454*t,b:.0719453*a-.2289914*n+1.4052427*t});return void 0!==e&&(o.alpha=e),o}function U(r){return Q(J(r))}function V(r){var a=E(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz",x:.4360747*n+.3850649*t+.1430804*e,y:.2225045*n+.7168786*t+.0606169*e,z:.0139322*n+.0971045*t+.7141733*e};return void 0!==o&&(i.alpha=o),i}var X=function(r){return r>K?Math.cbrt(r):(G*r+16)/116};function Y(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=X(a/W),i=X(n/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-X(t/_))};return void 0!==e&&(u.alpha=e),u}function Z(r){var a=Y(V(r));return r.r===r.b===r.g&&(a.a=a.b=0),a}var rr={mode:"lab",output:{xyz:J,rgb:U},input:{xyz:Y,rgb:Z},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 a=r.match(M);if(a){var n={mode:"lab",l:+a[1],a:+a[2],b:+a[3]};return void 0!==a[4]?n.alpha=a[4]/100:void 0!==a[5]&&(n.alpha=+a[5]),n}}}],interpolate:{l:q,a:q,b:q,alpha:{use:q,fixup:P}}};function ar(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=Math.sqrt(n*n+t*t),i={mode:"lch",l:a,c:o};return o&&(i.h=C(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}function nr(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"lab",l:a,a:n?n*Math.cos(t/180*Math.PI):0,b:n?n*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o}var tr={mode:"lch",output:{lab:nr,rgb:function(r){return U(nr(r))}},input:{rgb:function(r){return ar(Z(r))},lab:ar},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(r){if("string"==typeof r){var a=r.match(m);if(a){var n={mode:"lch",l:+a[1],c:Math.max(0,+a[2]),h:void 0===a[5]?N(a[3],a[4]):+a[5]};return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=+a[7]),n}}}],interpolate:{h:{use:q,fixup:j},c:q,l:q,alpha:{use:q,fixup:P}}},er=function(r,a,n){return 4*r/(r+15*a+3*n)},or=function(r,a,n){return 9*a/(r+15*a+3*n)},ir=er(W,1,_),ur=or(W,1,_);function hr(r){var a,n=r.x,t=r.y,e=r.z,o=r.alpha,i=(a=t/1)<=K?G*a:116*Math.cbrt(a)-16,u=er(n,t,e),h=or(n,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-ir),h=13*i*(h-ur)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l}function lr(r){return hr(V(r))}var cr,pr=4*(cr=W)/(cr+15*1+3*_),sr=function(r,a,n){return 9*a/(r+15*a+3*n)}(W,1,_);function fr(r){var a=r.l,n=r.u,t=r.v,e=r.alpha,o=n/(13*a)+pr,i=t/(13*a)+sr,u=1*(a<=8?a/G:Math.pow((a+16)/116,3)),h={mode:"xyz",x:u*(9*o)/(4*i),y:u,z:u*(12-3*o-20*i)/(4*i)};return void 0!==e&&(h.alpha=e),h}function dr(r){return Q(fr(r))}var vr={mode:"luv",output:{xyz:fr,rgb:dr},input:{xyz:hr,rgb:lr},channels:["l","u","v","alpha"],ranges:{l:[0,100],u:[-84.86,174.87],v:[-125.744,87.165],alpha:[0,1]},interpolate:{l:q,u:q,v:q,alpha:{use:q,fixup:P}}};function gr(r){var a=r.l,n=r.u,t=r.v,e=r.alpha,o=Math.sqrt(n*n+t*t),i={mode:"lchuv",l:a,c:o};return o&&(i.h=C(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}function br(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"luv",l:a,u:n?n*Math.cos(t/180*Math.PI):0,v:n?n*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o}var Mr={mode:"lchuv",output:{luv:br,rgb:function(r){return dr(br(r))}},input:{rgb:function(r){return gr(lr(r))},luv:gr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},interpolate:{h:{use:q,fixup:j},c:q,l:q,alpha:{use:q,fixup:P}}},mr=[-.14861,1.78277,-.29227,-.90649,1.97294,0],wr=Math.PI/180,yr=180/Math.PI,xr=mr[3]*mr[4],kr=mr[1]*mr[4],qr=mr[1]*mr[2]-mr[0]*mr[3];var Pr={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=(qr*t+a*xr-n*kr)/(qr+xr-kr),i=t-o,u=(mr[4]*(n-o)-mr[2]*i)/mr[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(mr[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*yr-120),void 0!==e&&(h.alpha=e),h}},output:{rgb:function(r){var a=r.h,n=r.s,t=r.l,e=r.alpha,o={mode:"rgb"};a=(void 0===a?0:a+120)*wr;var i=void 0===n?0:n*t*(1-t),u=Math.cos(a),h=Math.sin(a);return o.r=t+i*(mr[0]*u+mr[1]*h),o.g=t+i*(mr[2]*u+mr[3]*h),o.b=t+i*(mr[4]*u+mr[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:q,fixup:j},s:q,l:q,alpha:{use:q,fixup:P}}};function Ir(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=Math.sqrt(n*n+t*t),i={mode:"dlch",l:a,c:o};return o&&(i.h=C(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}var zr=26/180*Math.PI,Er=Math.cos(zr),Sr=Math.sin(zr),Ar=100/Math.log(1.39);function Rr(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"lab",l:(Math.exp(1*a/Ar)-1)/.0039};if(void 0===t)o.a=o.b=0;else{var i=(Math.exp(.0435*n*1*1)-1)/.075,u=i*Math.cos(t/180*Math.PI-zr),h=i*Math.sin(t/180*Math.PI-zr);o.a=u*Er-h/.83*Sr,o.b=u*Sr+h/.83*Er}return void 0!==e&&(o.alpha=e),o}function Cr(r){return Rr(Ir(r))}function Nr(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=n*Er+t*Sr,i=.83*(t*Er-n*Sr),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:Ar/1*Math.log(1+.0039*a),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=(Math.atan2(i,o)+zr)/Math.PI*180),void 0!==e&&(h.alpha=e),h}function $r(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"dlab",l:a,a:0===n?0:n*Math.cos(t/180*Math.PI),b:0===n?0:n*Math.sin(t/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}function jr(r){return $r(Nr(r))}var Or={mode:"dlab",output:{lab:Cr,rgb:function(r){return U(Cr(r))}},input:{lab:jr,rgb:function(r){return jr(Z(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 Hr={mode:"dlch",output:{lab:Rr,dlab:$r,rgb:function(r){return U(Rr(r))}},input:{lab:Nr,dlab:Ir,rgb:function(r){return Nr(Z(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:j},alpha:{use:q,fixup:P}}},Dr={mode:"xyz",output:{rgb:Q,lab:Y},input:{rgb:V,lab:J},channels:["x","y","z","alpha"],ranges:{x:[0,.962],y:[0,.997],z:[0,.823],alpha:[0,1]},interpolate:{x:q,y:q,z:q,alpha:{use:q,fixup:P}}};var Lr={mode:"yiq",output:{rgb:function(r){var a=r.y,n=r.i,t=r.q;return A({r:a+.95608445*n+.6208885*t,g:a-.27137664*n-.6486059*t,b:a-1.10561724*n+1.70250126*t,alpha:r.alpha})}},input:{rgb:function(r){var a=E(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"yiq",y:.29889531*n+.58662247*t+.11448223*e,i:.59597799*n-.2741761*t-.32180189*e,q:.21147017*n-.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}}},Br={},Fr={},Wr=[],_r=function(r){Br[r.mode]=Object.assign(Br[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(a){Br[a]||(Br[a]={}),Br[a][r.mode]=r.input[a]})),r.ranges||(r.ranges={}),r.channels.forEach((function(a){if(void 0===r.ranges[a]&&(r.ranges[a]=[0,1]),!r.interpolate[a])throw new Error("Missing interpolator for: "+a);"function"==typeof r.interpolate[a]&&(r.interpolate[a]={use:r.interpolate[a]}),r.interpolate[a].fixup||(r.interpolate[a].fixup=w)})),Fr[r.mode]=r,(r.parsers||[]).forEach((function(r){return Wr.push(r)}))},Gr=function(r){return Fr[r]},Kr=function(r){for(var a,n=0,t=Wr.length;n<t&&void 0===(a=Wr[n++](r)););return a};function Tr(r,a){return void 0===r?void 0:"object"!=typeof r?Kr(r):void 0!==r.mode?r:a?Object.assign({},r,{mode:a}):void 0}var Jr=function(r){return void 0===r&&(r="rgb"),function(a){return void 0!==(a=Tr(a,r))?a.mode===r?a:Br[a.mode][r]?Br[a.mode][r](a):"rgb"===r?Br[a.mode].rgb(a):Br.rgb[r](Br[a.mode].rgb(a)):void 0}};function Qr(r){return void 0===r&&(r=4),function(a){return"number"==typeof a?function(r,a){return Math.round(r*(a=Math.pow(10,a)))/a}(a,r):a}}function Ur(r){return Math.round(255*Math.max(0,Math.min(r,1)))}var Vr=Jr("rgb"),Xr=Qr(2),Yr=function(r){var a=Vr(r);if(void 0!==a)return"#"+(1<<24|Ur(a.r)<<16|Ur(a.g)<<8|Ur(a.b)).toString(16).slice(1)},Zr=function(r){var a=Vr(r);if(void 0!==a){var n=Ur(a.r),t=Ur(a.g),e=Ur(a.b);return void 0===a.alpha||1===a.alpha?"rgb("+n+", "+t+", "+e+")":"rgba("+n+", "+t+", "+e+", "+Xr(a.alpha)+")"}};function ra(r){return void 0===r&&(r=.5),function(a){return r<=0?1:r>=1?0:Math.pow(a,Math.log(.5)/Math.log(r))}}var aa=function(r,a){void 0===a&&(a="rgb");var n=a?Gr(a).channels:null,t=a?Jr(a):Tr;return function(e){var o=t(e);return(n||Gr(e.mode).channels).reduce((function(n,t){var e=r(o[t],t,o,a);return void 0===e||isNaN(e)||(n[t]=e),n}),{mode:a})}},na=function(r,a,n){return"alpha"!==a?(r||0)*(void 0!==n.alpha?n.alpha:1):r},ta=function(r,a,n){return"alpha"!==a&&0!==n.alpha?(r||0)/(void 0!==n.alpha?n.alpha:1):r},ea=function(r){return"function"==typeof r},oa=function(r){return r&&"object"==typeof r},ia=function(r){return"number"==typeof r},ua=function(r,a,n,t){void 0===a&&(a="rgb");var e=Gr(a),o=Jr(a),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):ia(r)||ea(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 a,n,t,e,o=1;o<r.length;){if(void 0===r[o]){for(n=o,t=r[o-1],a=o;void 0===r[a];)a++;for(e=(r[a]-t)/(a-o+1);o<a;)r[o]=t+(o+1-n)*e,o++}else r[o]<r[o-1]&&(r[o]=r[o-1]);o++}}(u);var l=e.channels.reduce((function(r,a){var t;return t=oa(n)&&oa(n[a])&&n[a].fixup?n[a].fixup:oa(e.interpolate[a])&&e.interpolate[a].fixup?e.interpolate[a].fixup:w,r[a]=t(i.map((function(r){return r[a]}))),r}),{});if(t){var c=i.map((function(r,n){return e.channels.reduce((function(r,a){return r[a]=l[a][n],r}),{mode:a})}));l=e.channels.reduce((function(r,n){return r[n]=c.map((function(r){var e=t(r[n],n,r,a);return isNaN(e)?void 0:e})),r}),{})}var p=e.channels.reduce((function(r,a){var t;return ea(n)?t=n:oa(n)&&ea(n[a])?t=n[a]:oa(n)&&oa(n[a])&&n[a].use?t=n[a].use:ea(e.interpolate[a])?t=e.interpolate[a]:oa(e.interpolate[a])&&(t=e.interpolate[a].use),r[a]=t(l[a]),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 n=0;u[n]<r;)n++;var t=u[n-1],o=u[n]-t,l=(r-t)/o,c=h[n]||h[0];void 0!==c&&(ia(c)&&(c=ra((c-t)/o)),l=c(l));var f=(n-1+l)/s;return e.channels.reduce((function(r,a){var n=p[a](f);return void 0!==n&&(r[a]=n),r}),{mode:a})}},ha=function(r,a){return function(n,t,e){void 0===t&&(t="rgb");var o=a?aa(a,t):void 0,i=ua(n,t,e,r);return o?function(r){return o(i(r))}:i}},la=ha(na,ta);function ca(r){return(1-Math.cos(r*Math.PI))/2}var pa=function(r,a,n,t,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*r+(4-6*o+3*i)*a+(1+3*e+3*o-3*i)*n+i*t)/6},sa=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return pa(t>0?r[t-1]:2*r[t]-r[t+1],r[t],r[t+1],t<n-1?r[t+2]:2*r[t+1]-r[t],(a-t/n)*n)}},fa=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return pa(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(a-t/n)*n)}},da=function(r){return function(r){throw new Error("open basis spline is not yet implemented")}},va=function(r){var a,n=r.length-1,t=new Array(n),e=new Array(n),o=new Array(n);for(t[1]=1/4,e[1]=(6*r[1]-r[0])/4,a=2;a<n;++a)t[a]=1/(4-t[a-1]),e[a]=(6*r[a]-(a==n-1?r[n]:0)-e[a-1])*t[a];for(o[0]=r[0],o[n]=r[n],n-1>0&&(o[n-1]=e[n-1]),a=n-2;a>0;--a)o[a]=e[a]-t[a]*o[a+1];return o},ga=function(r){return sa(va(r))},ba=function(r){return fa(va(r))},Ma=function(r){return da(va(r))},ma=Math.sign,wa=Math.min,ya=Math.abs,xa=function(r,a,n,t,e,o){var i=e*e,u=o*o,h=u*o,l=(n-a)/e,c=(a-r)/e,p=(n-r)/(2*e),s=(ma(c)+ma(l))*wa(ya(c),ya(l),.5*ya(p)),f=(t-n)/e,d=(t-a)/(2*e),v=(ma(l)+ma(f))*wa(ya(l),ya(f),.5*ya(d));return(s+v-2*l)/i*h+(3*l-2*s-v)/e*u+s*o+a},ka=function(r){return function(a){var n,t=r.length-1;return 1===a?(n=t-1,a=1):n=Math.floor(a*t),xa(n>0?r[n-1]:2*r[n]-r[n+1],r[n],r[n+1],n<t-1?r[n+2]:2*r[n+1]-r[n],1/t,a-n/t)}},qa=function(r){return function(a){var n,t=r.length-1;return 1===a?(n=t-1,a=1):n=Math.floor(a*t),xa(r[(n-1+r.length)%r.length],r[n],r[(n+1)%r.length],r[(n+2)%r.length],1/t,a-n/t)}},Pa=function(r){return function(a){var n,t=r.length-1;return 1===a?(n=t-1,a=1):n=Math.floor(a*t),xa(r[(n-1+r.length)%r.length],r[n],r[(n+1)%r.length],r[(n+2)%r.length],1/t,a-n/t)}};var Ia=Jr("rgb");function za(r){var a=Ia(r);return void 0!==a&&a.r>=0&&a.r<=1&&a.g>=0&&a.g<=1&&a.b>=0&&a.b<=1}var Ea=Jr("lch"),Sa=Jr("rgb"),Aa=function(r){var a=Sa(r);return a.r=Math.max(0,Math.min(a.r,1)),a.g=Math.max(0,Math.min(a.g,1)),a.b=Math.max(0,Math.min(a.b,1)),a},Ra=function(r){return void 0===(r=Tr(r))||za(r)?r:Jr(r.mode)(Aa(r))},Ca=function(r){if(void 0===(r=Tr(r))||za(r))return r;var a=Jr(r.mode);r=Ea(r);var n=Object.assign({},r,{c:0});if(!za(n))return a(Aa(r));for(var t=0,e=r.c;e-t>.01;)n.c=t+.5*(e-t),za(n)?t=n.c:e=n.c;return a(n)},Na=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a=[1,1,1,0]);var n=Gr(r).channels,t=Jr(r);return function(r,e){var o=t(r),i=t(e);return Math.sqrt(n.reduce((function(r,n,t){var e,u,h,l,c="h"===n?(e=o[n],u=i[n],h=C(e),l=C(u),Math.abs(l-h)>180?h-(l-360*Math.sign(l-h)):h-l):o[n]-i[n];return r+(a[t]||0)*Math.pow(isNaN(c)?0:c,2)}),0))}},$a=function(r){return r};var ja={normal:function(r,a){return a},multiply:function(r,a){return r*a},screen:function(r,a){return r+a-r*a},"hard-light":function(r,a){return a<.5?2*r*a:2*a*(1-r)-1},overlay:function(r,a){return r<.5?2*a*r:2*r*(1-a)-1},darken:function(r,a){return Math.min(r,a)},lighten:function(r,a){return Math.max(r,a)},"color-dodge":function(r,a){return 0===r?0:1===a?1:Math.min(1,r/(1-a))},"color-burn":function(r,a){return 1===r?1:0===a?0:1-Math.min(1,(1-r)/a)},"soft-light":function(r,a){return a<.5?r-(1-2*a)*r*(1-r):r+(2*a-1)*((r<.25?((16*r-12)*r+4)*r:Math.sqrt(r))-r)},difference:function(r,a){return Math.abs(r-a)},exclusion:function(r,a){return r+a-2*r*a}};function Oa(r){var a=Jr("lrgb")(r);return.2126*a.r+.7152*a.g+.0722*a.b}var Ha=Jr("rgb"),Da=[[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]],La=[[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]],Ba=[[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]],Fa=function(r,a){var n=Math.max(0,Math.min(1,a)),t=Math.round(n/.1),e=Math.round(n%.1),o=r[t];if(e>0&&t<r.length-1){var i=r[t+1];o=o.map((function(r,a){return y(o[a],i[a],e)}))}return function(r){var a=Tr(r);if(void 0!==a){var n=Ha(a),t=n.r,e=n.g,i=n.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!==a.alpha&&(u.alpha=a.alpha),Jr(a.mode)(u)}}};_r(I),_r(R),_r(O),_r(L),_r(B),_r(F),_r(rr),_r(tr),_r(vr),_r(Mr),_r(Pr),_r(Or),_r(Hr),_r(Lr),_r(Dr);var Wa=Jr("rgb"),_a=Jr("lrgb"),Ga=Jr("hsl"),Ka=Jr("hsv"),Ta=Jr("hsi"),Ja=Jr("hwb"),Qa=Jr("lab"),Ua=Jr("lch"),Va=Jr("luv"),Xa=Jr("lchuv"),Ya=Jr("cubehelix"),Za=Jr("dlab"),rn=Jr("dlch"),an=Jr("yiq"),nn=Jr("xyz");r.blend=function(r,a,n){void 0===a&&(a="normal"),void 0===n&&(n="rgb");var t="function"==typeof a?a:ja[a],e=Jr(n),o=Gr(n).channels;return r.map((function(r){var a=e(r);return void 0===a.alpha&&(a.alpha=1),a})).reduce((function(r,a){if(void 0===r)return a;var e=a.alpha+r.alpha*(1-a.alpha);return o.reduce((function(n,o){return"alpha"!==o&&(0===e?n[o]=0:(n[o]=a.alpha*(1-r.alpha)*a[o]+a.alpha*r.alpha*t(r[o],a[o])+(1-a.alpha)*r.alpha*r[o],n[o]=Math.max(0,Math.min(1,n[o]/e)))),n}),{mode:n,alpha:e})}))},r.clamp=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return Ra;case"lch":return Ca}},r.clampChroma=Ca,r.clampRgb=Ra,r.colorsNamed=n,r.converter=Jr,r.cubehelix=Ya,r.deficiencyDeuter=function(r){return void 0===r&&(r=1),Fa(La,r)},r.deficiencyProt=function(r){return void 0===r&&(r=1),Fa(Da,r)},r.deficiencyTrit=function(r){return void 0===r&&(r=1),Fa(Ba,r)},r.defineMode=_r,r.differenceCie76=function(){return Na("lab")},r.differenceCie94=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=.045),void 0===n&&(n=.015);var t=Jr("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+a*p,2)+M/Math.pow(1+n*p,2))}},r.differenceCiede2000=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=1);var t=Jr("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,z=2*Math.sqrt(m*w)*Math.sin(P/2),E=(h+s)/2,S=(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 A=Math.pow(E-50,2),R=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*A/Math.sqrt(20+A),N=1+.045*S,$=1+.015*S*R,j=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),O=2*Math.sqrt(Math.pow(S,7)/(Math.pow(S,7)+Math.pow(25,7))),H=-1*Math.sin(2*j)*O;return Math.sqrt(Math.pow(k/(r*C),2)+Math.pow(q/(a*N),2)+Math.pow(z/(n*$),2)+H*q/(a*N)*z/(n*$))}},r.differenceCmc=function(r,a){void 0===r&&(r=1),void 0===a&&(a=1);var n=Jr("lab");return function(t,e){var o=n(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=n(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(a*y,2)+M/Math.pow(x,2))}},r.differenceDin99o=function(){return Na("dlab")},r.differenceEuclidean=Na,r.differenceKotsarenkoRamos=function(){return Na("yiq",[.5053,.299,.1957])},r.displayable=za,r.dlab=Za,r.dlch=rn,r.easingGamma=x,r.easingInOutSine=ca,r.easingMidpoint=ra,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 $(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return $(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return $(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=j,r.formatHex=Yr,r.formatHex8=function(r){var a=Vr(r);if(void 0!==a){var n=Ur(void 0!==a.alpha?a.alpha:1);return Yr(a)+(256|n).toString(16).slice(1)}},r.formatRgb=Zr,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return Zr;case"hex":return Yr}},r.getModeDefinition=Gr,r.hsi=Ta,r.hsl=Ga,r.hsv=Ka,r.hwb=Ja,r.interpolate=function(r,a,n){return void 0===a&&(a="rgb"),ua(r,a,n)},r.interpolateAlpha=P,r.interpolateCosine=function(r,a){return void 0===a&&(a=1),function(n){var t=x(a),e=k((function(r,a,n){return y(r,a,ca(n))}))((r||w)(n));return function(r){return e(t(r))}}},r.interpolateHue=j,r.interpolateLinear=function(r,a){return void 0===a&&(a=1),function(n){var t=x(a);return function(a){return q((r||w)(n))(t(a))}}},r.interpolateSplineBasis=function(r,a,n){return void 0===a&&(a="default"),void 0===n&&(n=1),function(t){var e=x(n);return"default"===a?function(a){return sa((r||w)(t))(e(a))}:"closed"===a?function(a){return fa((r||w)(t))(e(a))}:"open"===a?function(a){return da((r||w)(t))(e(a))}:void 0}},r.interpolateSplineMonotone=function(r,a,n){return void 0===a&&(a="default"),void 0===n&&(n=1),function(t){var e=x(n);return"closed"===a?function(a){return qa((r||w)(t))(e(a))}:"open"===a?function(a){return Pa((r||w)(t))(e(a))}:"default"===a?function(a){return ka((r||w)(t))(e(a))}:void 0}},r.interpolateSplineNatural=function(r,a,n){return void 0===a&&(a="default"),void 0===n&&(n=1),function(t){var e=x(n);return"default"===a?function(a){return ga((r||w)(t))(e(a))}:"closed"===a?function(a){return ba((r||w)(t))(e(a))}:"open"===a?function(a){return Ma((r||w)(t))(e(a))}:void 0}},r.interpolateWith=ha,r.interpolateWithPremultipliedAlpha=la,r.interpolatorLinear=q,r.interpolatorPiecewise=k,r.interpolatorSplineBasis=sa,r.interpolatorSplineBasisClosed=fa,r.interpolatorSplineBasisOpen=da,r.interpolatorSplineMonotone=ka,r.interpolatorSplineMonotoneClosed=qa,r.interpolatorSplineMonotoneOpen=Pa,r.interpolatorSplineNatural=ga,r.interpolatorSplineNaturalClosed=ba,r.interpolatorSplineNaturalOpen=Ma,r.lab=Qa,r.lch=Ua,r.lchuv=Xa,r.lerp=y,r.lrgb=_a,r.luv=Va,r.mapAlphaDivide=ta,r.mapAlphaMultiply=na,r.mapper=aa,r.nearest=function(r,a,n){void 0===a&&(a=Na()),void 0===n&&(n=$a);var t=r.map((function(r,a){return{color:n(r),i:a}}));return function(n,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=a(n,r.color)})),t.sort((function(r,a){return r.d-a.d})).slice(0,e).filter((function(r){return r.d<o})).map((function(a){return r[a.i]}))}},r.parse=Kr,r.random=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a={});var n=Gr(r),t=function(r){return Object.keys(r).reduce((function(a,n){var t=r[n];return a[n]=Array.isArray(t)?t:[t,t],a}),{})}(a);return n.channels.reduce((function(r,a){return(t.alpha||"alpha"!==a)&&(r[a]=function(r){var a=r[0],n=r[1];return a+Math.random()*(n-a)}(t[a]||n.ranges[a])),r}),{mode:r})},r.rgb=Wa,r.round=Qr,r.samples=function(r,a){void 0===r&&(r=2),void 0===a&&(a=1);var n=x(a);if(r<2)return r<1?[]:[n(.5)];for(var t=[],e=0;e<r;e++)t.push(n(e/(r-1)));return t},r.wcagContrast=function(r,a){var n=Oa(r),t=Oa(a);return(Math.max(n,t)+.05)/(Math.min(n,t)+.05)},r.wcagLuminance=Oa,r.xyz=nn,r.yiq=an,Object.defineProperty(r,"__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*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),s=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(p))a={mode:"rgb",r:n[1]/255,g:n[2]/255,b:n[3]/255};else{if(!(n=r.match(f)||r.match(s)))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}}},z=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:z(n),g:z(a),b:z(t)};return void 0!==e&&(o.alpha=e),o}var E=function(r){return r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r};function A(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o={mode:"rgb",r:E(n),g:E(a),b:E(t)};return void 0!==e&&(o.alpha=e),o}var C={mode:"lrgb",output:{rgb:A},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 R=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 $=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)}),[])},j=function(r){return $(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},H={},O={},D=[],L=function(r){H[r.mode]=Object.assign(H[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(n){H[n]||(H[n]={}),H[n][r.mode]=r.input[n]})),r.ranges||(r.ranges={}),r.difference||(r.difference={}),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)})),O[r.mode]=r,(r.parsers||[]).forEach((function(r){return D.push(r)}))},B=function(r){return O[r]},F=function(r){for(var n,a=0,t=D.length;a<t&&void 0===(n=D[a++](r)););return n};function W(r,n){return void 0===r?void 0:"object"!=typeof r?F(r):void 0!==r.mode?r:n?Object.assign({},r,{mode:n}):void 0}var _=function(r){return void 0===r&&(r="rgb"),function(n){return void 0!==(n=W(n,r))?n.mode===r?n:H[n.mode][r]?H[n.mode][r](n):"rgb"===r?H[n.mode].rgb(n):H.rgb[r](H[n.mode].rgb(n)):void 0}},G=function(r,n){if(void 0===r.h||void 0===n.h||!r.s||!n.s)return 0;var a=N(r.h),t=N(n.h),e=Math.sin((t-a+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*n.s)*e},K=function(r,n){var a=N(r.h),t=N(n.h);return Math.abs(t-a)>180?a-(t-360*Math.sign(t-a)):t-a},T=function(r,n){if(void 0===r.h||void 0===n.h||!r.c||!n.c)return 0;var a=N(r.h),t=N(n.h),e=Math.sin((t-a+360)/2*Math.PI/180);return 2*Math.sqrt(r.c*n.c)*e},J=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n=[1,1,1,0]);var a=B(r),t=a.channels,e=a.difference,o=_(r);return function(r,a){var i=o(r),u=o(a);return Math.sqrt(t.reduce((function(r,a,t){var o=e[a]?e[a](i,u):i[a]-u[a];return r+(n[t]||0)*Math.pow(isNaN(o)?0:o,2)}),0))}},Q={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]?R(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:j},s:q,l:q,alpha:{use:q,fixup:P}},difference:{h:G}};function U(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 V(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 X={mode:"hsv",output:{rgb:U},input:{rgb:V},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:q,fixup:j},s:q,v:q,alpha:{use:q,fixup:P}},difference:{h:G}};var Y={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:j},s:q,i:q,alpha:{use:q,fixup:P}},difference:{h:G}};var Z={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 U({h:n,s:1===t?1:1-a/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var n=V(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]?R(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:j},w:q,b:q,alpha:{use:q,fixup:P}},difference:{h:K}},rr=.96422,nr=.82521,ar=Math.pow(29,3)/Math.pow(3,3),tr=Math.pow(6,3)/Math.pow(29,3),er=function(r){return Math.pow(r,3)>tr?Math.pow(r,3):(116*r-16)/ar};function or(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=(n+16)/116,i=o-t/200,u={mode:"xyz",x:er(a/500+o)*rr,y:1*er(o),z:er(i)*nr};return void 0!==e&&(u.alpha=e),u}function ir(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=A({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});return void 0!==e&&(o.alpha=e),o}function ur(r){return ir(or(r))}function hr(r){var n=S(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"xyz",x:.4360747*a+.3850649*t+.1430804*e,y:.2225045*a+.7168786*t+.0606169*e,z:.0139322*a+.0971045*t+.7141733*e};return void 0!==o&&(i.alpha=o),i}var lr=function(r){return r>tr?Math.cbrt(r):(ar*r+16)/116};function cr(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=lr(n/rr),i=lr(a/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-lr(t/nr))};return void 0!==e&&(u.alpha=e),u}function fr(r){var n=cr(hr(r));return r.r===r.b===r.g&&(n.a=n.b=0),n}var pr={mode:"lab",output:{xyz:or,rgb:ur},input:{xyz:cr,rgb:fr},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 sr(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 dr(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 vr={mode:"lch",output:{lab:dr,rgb:function(r){return ur(dr(r))}},input:{rgb:function(r){return sr(fr(r))},lab:sr},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]?R(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:j},c:q,l:q,alpha:{use:q,fixup:P}},difference:{h:T}},gr=function(r,n,a){return 4*r/(r+15*n+3*a)},br=function(r,n,a){return 9*n/(r+15*n+3*a)},Mr=gr(rr,1,nr),mr=br(rr,1,nr);function wr(r){var n,a=r.x,t=r.y,e=r.z,o=r.alpha,i=(n=t/1)<=tr?ar*n:116*Math.cbrt(n)-16,u=gr(a,t,e),h=br(a,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-Mr),h=13*i*(h-mr)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l}function yr(r){return wr(hr(r))}var xr,kr=4*(xr=rr)/(xr+15*1+3*nr),qr=function(r,n,a){return 9*n/(r+15*n+3*a)}(rr,1,nr);function Pr(r){var n=r.l,a=r.u,t=r.v,e=r.alpha,o=a/(13*n)+kr,i=t/(13*n)+qr,u=1*(n<=8?n/ar:Math.pow((n+16)/116,3)),h={mode:"xyz",x:u*(9*o)/(4*i),y:u,z:u*(12-3*o-20*i)/(4*i)};return void 0!==e&&(h.alpha=e),h}function Ir(r){return ir(Pr(r))}var zr={mode:"luv",output:{xyz:Pr,rgb:Ir},input:{xyz:wr,rgb:yr},channels:["l","u","v","alpha"],ranges:{l:[0,100],u:[-84.86,174.87],v:[-125.744,87.165],alpha:[0,1]},interpolate:{l:q,u:q,v:q,alpha:{use:q,fixup:P}}};function Sr(r){var n=r.l,a=r.u,t=r.v,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"lchuv",l:n,c:o};return o&&(i.h=N(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i}function Er(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"luv",l:n,u:a?a*Math.cos(t/180*Math.PI):0,v:a?a*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o}var Ar={mode:"lchuv",output:{luv:Er,rgb:function(r){return Ir(Er(r))}},input:{rgb:function(r){return Sr(yr(r))},luv:Sr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},interpolate:{h:{use:q,fixup:j},c:q,l:q,alpha:{use:q,fixup:P}},difference:{h:T}},Cr=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Nr=Math.PI/180,Rr=180/Math.PI,$r=Cr[3]*Cr[4],jr=Cr[1]*Cr[4],Hr=Cr[1]*Cr[2]-Cr[0]*Cr[3];var Or={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=(Hr*t+n*$r-a*jr)/(Hr+$r-jr),i=t-o,u=(Cr[4]*(a-o)-Cr[2]*i)/Cr[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(Cr[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)*Nr;var i=void 0===a?0:a*t*(1-t),u=Math.cos(n),h=Math.sin(n);return o.r=t+i*(Cr[0]*u+Cr[1]*h),o.g=t+i*(Cr[2]*u+Cr[3]*h),o.b=t+i*(Cr[4]*u+Cr[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:q,fixup:j},s:q,l:q,alpha:{use:q,fixup:P}},difference:{h:G}};function Dr(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 Lr=26/180*Math.PI,Br=Math.cos(Lr),Fr=Math.sin(Lr),Wr=100/Math.log(1.39);function _r(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"lab",l:(Math.exp(1*n/Wr)-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-Lr),h=i*Math.sin(t/180*Math.PI-Lr);o.a=u*Br-h/.83*Fr,o.b=u*Fr+h/.83*Br}return void 0!==e&&(o.alpha=e),o}function Gr(r){return _r(Dr(r))}function Kr(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=a*Br+t*Fr,i=.83*(t*Br-a*Fr),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:Wr/1*Math.log(1+.0039*n),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=(Math.atan2(i,o)+Lr)/Math.PI*180),void 0!==e&&(h.alpha=e),h}function Tr(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 Jr(r){return Tr(Kr(r))}var Qr={mode:"dlab",output:{lab:Gr,rgb:function(r){return ur(Gr(r))}},input:{lab:Jr,rgb:function(r){return Jr(fr(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 Ur={mode:"dlch",output:{lab:_r,dlab:Tr,rgb:function(r){return ur(_r(r))}},input:{lab:Kr,dlab:Dr,rgb:function(r){return Kr(fr(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:j},alpha:{use:q,fixup:P}},difference:{h:T}},Vr={mode:"xyz",output:{rgb:ir,lab:cr},input:{rgb:hr,lab:or},channels:["x","y","z","alpha"],ranges:{x:[0,.962],y:[0,.997],z:[0,.823],alpha:[0,1]},interpolate:{x:q,y:q,z:q,alpha:{use:q,fixup:P}}};var Xr={mode:"yiq",output:{rgb:function(r){var n=r.y,a=r.i,t=r.q;return A({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}}};function Yr(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 Zr(r){return Math.round(255*Math.max(0,Math.min(r,1)))}var rn=_("rgb"),nn=Yr(2),an=function(r){var n=rn(r);if(void 0!==n)return"#"+(1<<24|Zr(n.r)<<16|Zr(n.g)<<8|Zr(n.b)).toString(16).slice(1)},tn=function(r){var n=rn(r);if(void 0!==n){var a=Zr(n.r),t=Zr(n.g),e=Zr(n.b);return void 0===n.alpha||1===n.alpha?"rgb("+a+", "+t+", "+e+")":"rgba("+a+", "+t+", "+e+", "+nn(n.alpha)+")"}};function en(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 on=function(r,n){void 0===n&&(n="rgb");var a=n?B(n).channels:null,t=n?_(n):W;return function(e){var o=t(e);return(a||B(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})}},un=function(r,n,a){return"alpha"!==n?(r||0)*(void 0!==a.alpha?a.alpha:1):r},hn=function(r,n,a){return"alpha"!==n&&0!==a.alpha?(r||0)/(void 0!==a.alpha?a.alpha:1):r},ln=function(r){return"function"==typeof r},cn=function(r){return r&&"object"==typeof r},fn=function(r){return"number"==typeof r},pn=function(r,n,a,t){void 0===n&&(n="rgb");var e=B(n),o=_(n),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):fn(r)||ln(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=cn(a)&&cn(a[n])&&a[n].fixup?a[n].fixup:cn(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 f=e.channels.reduce((function(r,n){var t;return ln(a)?t=a:cn(a)&&ln(a[n])?t=a[n]:cn(a)&&cn(a[n])&&a[n].use?t=a[n].use:ln(e.interpolate[n])?t=e.interpolate[n]:cn(e.interpolate[n])&&(t=e.interpolate[n].use),r[n]=t(l[n]),r}),{}),p=i.length-1;return function(r){if((r=Math.min(Math.max(0,r),1))<=u[0])return i[0];if(r>u[p])return i[p];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&&(fn(c)&&(c=en((c-t)/o)),l=c(l));var s=(a-1+l)/p;return e.channels.reduce((function(r,n){var a=f[n](s);return void 0!==a&&(r[n]=a),r}),{mode:n})}},sn=function(r,n){return function(a,t,e){void 0===t&&(t="rgb");var o=n?on(n,t):void 0,i=pn(a,t,e,r);return o?function(r){return o(i(r))}:i}},dn=sn(un,hn);function vn(r){return(1-Math.cos(r*Math.PI))/2}var gn=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},bn=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return gn(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)}},Mn=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return gn(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(n-t/a)*a)}},mn=function(r){return function(r){throw new Error("open basis spline is not yet implemented")}},wn=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},yn=function(r){return bn(wn(r))},xn=function(r){return Mn(wn(r))},kn=function(r){return mn(wn(r))},qn=Math.sign,Pn=Math.min,In=Math.abs,zn=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,f=(a-r)/(2*e),p=(qn(c)+qn(l))*Pn(In(c),In(l),.5*In(f)),s=(t-a)/e,d=(t-n)/(2*e),v=(qn(l)+qn(s))*Pn(In(l),In(s),.5*In(d));return(p+v-2*l)/i*h+(3*l-2*p-v)/e*u+p*o+n},Sn=function(r){return function(n){var a,t=r.length-1;return 1===n?(a=t-1,n=1):a=Math.floor(n*t),zn(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)}},En=function(r){return function(n){var a,t=r.length-1;return 1===n?(a=t-1,n=1):a=Math.floor(n*t),zn(r[(a-1+r.length)%r.length],r[a],r[(a+1)%r.length],r[(a+2)%r.length],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),zn(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 Cn=_("rgb");function Nn(r){var n=Cn(r);return void 0!==n&&n.r>=0&&n.r<=1&&n.g>=0&&n.g<=1&&n.b>=0&&n.b<=1}var Rn=_("lch"),$n=_("rgb"),jn=function(r){var n=$n(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},Hn=function(r){return void 0===(r=W(r))||Nn(r)?r:_(r.mode)(jn(r))},On=function(r){if(void 0===(r=W(r))||Nn(r))return r;var n=_(r.mode);r=Rn(r);var a=Object.assign({},r,{c:0});if(!Nn(a))return n(jn(r));for(var t=0,e=r.c;e-t>.01;)a.c=t+.5*(e-t),Nn(a)?t=a.c:e=a.c;return n(a)},Dn=function(r){return r};var Ln={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 Bn(r){var n=_("lrgb")(r);return.2126*n.r+.7152*n.g+.0722*n.b}var Fn=_("rgb"),Wn=[[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]],_n=[[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]],Gn=[[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]],Kn=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=W(r);if(void 0!==n){var a=Fn(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),_(n.mode)(u)}}};L(I),L(C),L(Q),L(X),L(Y),L(Z),L(pr),L(vr),L(zr),L(Ar),L(Or),L(Qr),L(Ur),L(Xr),L(Vr);var Tn=_("rgb"),Jn=_("lrgb"),Qn=_("hsl"),Un=_("hsv"),Vn=_("hsi"),Xn=_("hwb"),Yn=_("lab"),Zn=_("lch"),ra=_("luv"),na=_("lchuv"),aa=_("cubehelix"),ta=_("dlab"),ea=_("dlch"),oa=_("yiq"),ia=_("xyz");r.blend=function(r,n,a){void 0===n&&(n="normal"),void 0===a&&(a="rgb");var t="function"==typeof n?n:Ln[n],e=_(a),o=B(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 Hn;case"lch":return On}},r.clampChroma=On,r.clampRgb=Hn,r.colorsNamed=a,r.converter=_,r.cubehelix=aa,r.deficiencyDeuter=function(r){return void 0===r&&(r=1),Kn(_n,r)},r.deficiencyProt=function(r){return void 0===r&&(r=1),Kn(Wn,r)},r.deficiencyTrit=function(r){return void 0===r&&(r=1),Kn(Gn,r)},r.defineMode=L,r.differenceCie76=function(){return J("lab")},r.differenceCie94=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=.045),void 0===a&&(a=.015);var t=_("lab");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,s=u.a,d=u.b,v=Math.sqrt(s*s+d*d),g=Math.pow(h-p,2),b=Math.pow(f-v,2),M=Math.pow(l-s,2)+Math.pow(c-d,2)-b;return Math.sqrt(g/Math.pow(r,2)+b/Math.pow(1+n*f,2)+M/Math.pow(1+a*f,2))}},r.differenceCiede2000=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=1);var t=_("lab");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,s=u.a,d=u.b,v=(f+Math.sqrt(s*s+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=s*(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=p-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,z=2*Math.sqrt(m*w)*Math.sin(P/2),S=(h+p)/2,E=(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 A=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*A/Math.sqrt(20+A),R=1+.045*E,$=1+.015*E*C,j=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),H=2*Math.sqrt(Math.pow(E,7)/(Math.pow(E,7)+Math.pow(25,7))),O=-1*Math.sin(2*j)*H;return Math.sqrt(Math.pow(k/(r*N),2)+Math.pow(q/(n*R),2)+Math.pow(z/(a*$),2)+O*q/(n*R)*z/(a*$))}},r.differenceCmc=function(r,n){void 0===r&&(r=1),void 0===n&&(n=1);var a=_("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 f=a(e),p=f.l,s=f.a,d=f.b,v=Math.sqrt(s*s+d*d),g=Math.pow(i-p,2),b=Math.pow(l-v,2),M=Math.pow(u-s,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 J("dlab")},r.differenceEuclidean=J,r.differenceHueChroma=T,r.differenceHueNaive=K,r.differenceHueSaturation=G,r.differenceKotsarenkoRamos=function(){return J("yiq",[.5053,.299,.1957])},r.displayable=Nn,r.dlab=ta,r.dlch=ea,r.easingGamma=x,r.easingInOutSine=vn,r.easingMidpoint=en,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 $(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return $(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return $(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=j,r.formatHex=an,r.formatHex8=function(r){var n=rn(r);if(void 0!==n){var a=Zr(void 0!==n.alpha?n.alpha:1);return an(n)+(256|a).toString(16).slice(1)}},r.formatRgb=tn,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return tn;case"hex":return an}},r.getModeDefinition=B,r.hsi=Vn,r.hsl=Qn,r.hsv=Un,r.hwb=Xn,r.interpolate=function(r,n,a){return void 0===n&&(n="rgb"),pn(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,vn(a))}))((r||w)(a));return function(r){return e(t(r))}}},r.interpolateHue=j,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 bn((r||w)(t))(e(n))}:"closed"===n?function(n){return Mn((r||w)(t))(e(n))}:"open"===n?function(n){return mn((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 En((r||w)(t))(e(n))}:"open"===n?function(n){return An((r||w)(t))(e(n))}:"default"===n?function(n){return Sn((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 yn((r||w)(t))(e(n))}:"closed"===n?function(n){return xn((r||w)(t))(e(n))}:"open"===n?function(n){return kn((r||w)(t))(e(n))}:void 0}},r.interpolateWith=sn,r.interpolateWithPremultipliedAlpha=dn,r.interpolatorLinear=q,r.interpolatorPiecewise=k,r.interpolatorSplineBasis=bn,r.interpolatorSplineBasisClosed=Mn,r.interpolatorSplineBasisOpen=mn,r.interpolatorSplineMonotone=Sn,r.interpolatorSplineMonotoneClosed=En,r.interpolatorSplineMonotoneOpen=An,r.interpolatorSplineNatural=yn,r.interpolatorSplineNaturalClosed=xn,r.interpolatorSplineNaturalOpen=kn,r.lab=Yn,r.lch=Zn,r.lchuv=na,r.lerp=y,r.lrgb=Jn,r.luv=ra,r.mapAlphaDivide=hn,r.mapAlphaMultiply=un,r.mapper=on,r.nearest=function(r,n,a){void 0===n&&(n=J()),void 0===a&&(a=Dn);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=F,r.random=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n={});var a=B(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=Tn,r.round=Yr,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=Bn(r),t=Bn(n);return(Math.max(a,t)+.05)/(Math.min(a,t)+.05)},r.wcagLuminance=Bn,r.xyz=ia,r.yiq=oa,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "culori",
"version": "0.12.3",
"version": "0.12.5",
"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