You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
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

Comparing version 0.20.0 to 0.20.1

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="undefined"!=typeof globalThis?globalThis:r||self).culori={})}(this,(function(r){"use strict";var a=function(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},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},t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o="(?:"+t+"%|"+t+")",i="(?:"+t+"(deg|grad|rad|turn)|"+t+")",u="\\s*,\\s*",h="\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+u+t+u+t+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),s=new RegExp("^rgba?\\(\\s*"+e+u+e+u+e+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),d=new RegExp("^hsla?\\(\\s*"+i+u+e+u+e+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+i+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+i+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+t+"%?"+l+t+l+t+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+t+"%?"+l+t+l+i+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),y=new RegExp("^color\\(\\s*([a-z0-9\\-]+)"+l+o+l+o+l+o+"\\s*(?:\\/"+h+o+"\\s*)?\\)$"),x=function(r,a,n){return r+n*(a-r)},w=function(r){return void 0===r&&(r=1),1===r?function(r){return r}:function(a){return Math.pow(a,r)}},z=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)}}},k=z(x),P=function(r){var a=!1,n=r.map((function(r){return void 0!==r?(a=!0,r):1}));return a?n:r},q={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(r){var n;return(n=r.match(b))?a(parseInt(n[1],16),n[1].length):void 0},function(r){var a,n;if(a=r.match(c)||r.match(p))n={mode:"rgb",r:a[1]/255,g:a[2]/255,b:a[3]/255};else{if(!(a=r.match(s)||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 a(n[r.toLowerCase()],6)},function(r){return"transparent"===r?a(0,8):void 0},"srgb"],serialize:"color(srgb ",interpolate:{r:k,g:k,b:k,alpha:{use:k,fixup:P}}},I=function(r){var a=Math.abs(r);return a<.04045?r/12.92:(Math.sign(r)||1)*Math.pow((a+.055)/1.055,2.4)},j=function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o={mode:"lrgb",r:I(a),g:I(n),b:I(t)};return void 0!==e&&(o.alpha=e),o},E=function(r){var a=Math.abs(r);return a>.0031308?(Math.sign(r)||1)*(1.055*Math.pow(a,1/2.4)-.055):12.92*r},S=function(r,a){var n=r.r,t=r.g,e=r.b,o=r.alpha;void 0===a&&(a="rgb");var i={mode:a,r:E(n),g:E(t),b:E(e)};return void 0!==o&&(i.alpha=o),i},O=Object.assign({},q,{mode:"lrgb",output:{rgb:S},input:{rgb:j},parsers:["--srgb-linear"],serialize:"color(--srgb-linear "}),C=function(r){return Math.pow(Math.abs(r),563/256)*Math.sign(r)},R=function(r){var a=C(r.r),n=C(r.g),t=C(r.b),e={mode:"xyz65",x:.5766690429101305*a+.1855582379065463*n+.1882286462349947*t,y:.29734497525053605*a+.6273635662554661*n+.07529145849399788*t,z:.02703136138641234*a+.07068885253582723*n+.9913375368376388*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},A=function(r){return Math.pow(Math.abs(r),256/563)*Math.sign(r)},H=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"a98",r:A(2.0415879038107465*a-.5650069742788596*n-.34473135077832956*t),g:A(-.9692436362808795*a+1.8759675015077202*n+.04155505740717557*t),b:A(.013444280632031142*a-.11836239223101838*n+1.0151749943912054*t)};return void 0!==e&&(o.alpha=e),o},N=function(r){var a=j(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz65",x:.4124564*n+.3575761*t+.1804375*e,y:.2126729*n+.7151522*t+.072175*e,z:.0193339*n+.119192*t+.9503041*e};return void 0!==o&&(i.alpha=o),i},$=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({r:3.2404542*a-1.5371385*n-.4985314*t,g:-.969266*a+1.8760108*n+.041556*t,b:.0556434*a-.2040259*n+1.0572252*t});return void 0!==e&&(o.alpha=e),o},D=Object.assign({},q,{mode:"a98",parsers:["a98-rgb"],serialize:"color(a98-rgb ",input:{rgb:function(r){return H(N(r))},xyz65:H},output:{rgb:function(r){return $(R(r))},xyz65:R}}),L=function(r){var a=j(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz65",x:.4865709*n+.2656676*t+.1982172*e,y:.2289745*n+.6917385*t+.0792869*e,z:0*n+.0451133*t+1.0439443*e};return void 0!==o&&(i.alpha=o),i},T=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({r:2.4934969*a-.9313836*n-.4027107*t,g:-.8294889*a+1.762664*n+.0236246*t,b:.0358458*a-.0761723*n+.9568845*t},"p3");return void 0!==e&&(o.alpha=e),o},B=Object.assign({},q,{mode:"p3",parsers:["display-p3"],serialize:"color(display-p3 ",input:{rgb:function(r){return T(N(r))},xyz65:T},output:{rgb:function(r){return $(L(r))},xyz65:L}}),F=function(r){var a=Math.abs(r);return a>=1/512?Math.sign(r)*Math.pow(a,1/1.8):16*r},G=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"prophoto",r:F(1.3457989731028281*a-.25558010007997534*n-.05110628506753401*t),g:F(-.5446224939028347*a+1.5082327413132781*n+.02053603239147973*t),b:F(0*a+0*n+1.2119675456389454*t)};return void 0!==e&&(o.alpha=e),o},W=function(r){var a=Math.abs(r);return a>=16/512?Math.sign(r)*Math.pow(a,1.8):r/16},_=function(r){var a=W(r.r),n=W(r.g),t=W(r.b),e={mode:"xyz65",x:.7977604896723027*a+.13518583717574031*n+.0313493495815248*t,y:.2880711282292934*a+.7118432178101014*n+8565396060525902e-20*t,z:0*a+0*n+.8251046025104601*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},K=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({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},J=function(r){var a=j(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},Q=Object.assign({},q,{mode:"prophoto",parsers:["prophoto-rgb"],serialize:"color(prophoto-rgb ",input:{xyz:G,rgb:function(r){return G(J(r))}},output:{xyz:_,rgb:function(r){return K(_(r))}}}),U=1.09929682680944,V=function(r){var a=Math.abs(r);return a>.018053968510807?(Math.sign(r)||1)*(U*Math.pow(a,.45)-(U-1)):4.5*r},X=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"rec2020",r:V(1.7166511879712674*a-.35567078377639233*n-.25336628137365974*t),g:V(-.6666843518324892*a+1.6164812366349395*n+.01576854581391113*t),b:V(.017639857445310783*a-.042770613257808524*n+.9421031212354738*t)};return void 0!==e&&(o.alpha=e),o},Y=1.09929682680944,Z=function(r){var a=Math.abs(r);return a<.08124285829863151?r/4.5:(Math.sign(r)||1)*Math.pow((a+Y-1)/Y,1/.45)},rr=function(r){var a=Z(r.r),n=Z(r.g),t=Z(r.b),e={mode:"xyz65",x:.6369580483012914*a+.14461690358620832*n+.1688809751641721*t,y:.2627002120112671*a+.6779980715188708*n+.05930171646986196*t,z:0*a+.028072693049087428*n+1.060985057710791*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},ar=Object.assign({},q,{mode:"rec2020",input:{xyz:X,rgb:function(r){return X(N(r))}},output:{xyz:rr,rgb:function(r){return $(rr(r))}},parsers:["rec2020"],serialize:"color(rec2020 "}),nr=function(r){return(r%=360)<0?r+360:r};var tr=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}},er=function(r,a){return r.map((function(n,t,e){if(void 0===n)return n;var o=nr(n);return 0===t||void 0===r[t-1]?o:a(o-nr(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)}),[])},or=function(r){return er(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},ir={},ur={},hr=[],lr={},cr=function(r){return r},sr=function(r){ir[r.mode]=Object.assign(ir[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(a){ir[a]||(ir[a]={}),ir[a][r.mode]=r.input[a]})),r.ranges||(r.ranges={}),r.difference||(r.difference={}),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=cr)})),ur[r.mode]=r,(r.parsers||[]).forEach((function(a){"function"==typeof a?hr.push(a):"string"==typeof a&&(lr[a]=r.mode)}))},pr=function(r){return ur[r]},fr=function(r){if("string"==typeof r){for(var a=void 0,n=0,t=hr.length;n<t&&void 0===(a=hr[n++](r)););return a||function(r){var a=r.match(y);if(a){var n=lr[a[1]];if(n){var t={mode:n},e=2;return pr(n).channels.forEach((function(r){void 0===a[e]&&void 0===a[e+1]||(t[r]=void 0!==a[e]?a[e]/100:+a[e+1]),e+=2})),t}}}(r)}},dr=function(r,a){return void 0===r?void 0:"object"!=typeof r?fr(r):void 0!==r.mode?r:a?Object.assign({},r,{mode:a}):void 0},vr=function(r){return void 0===r&&(r="rgb"),function(a){return void 0!==(a=dr(a,r))?a.mode===r?a:ir[a.mode][r]?ir[a.mode][r](a):"rgb"===r?ir[a.mode].rgb(a):ir.rgb[r](ir[a.mode].rgb(a)):void 0}},br=function(r,a){if(void 0===r.h||void 0===a.h||!r.s||!a.s)return 0;var n=nr(r.h),t=nr(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*a.s)*e},gr=function(r,a){if(void 0===r.h||void 0===a.h)return 0;var n=nr(r.h),t=nr(a.h);return Math.abs(t-n)>180?n-(t-360*Math.sign(t-n)):t-n},Mr=function(r,a){if(void 0===r.h||void 0===a.h||!r.c||!a.c)return 0;var n=nr(r.h),t=nr(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.c*a.c)*e},mr=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a=[1,1,1,0]);var n=pr(r),t=n.channels,e=n.difference,o=vr(r);return function(r,n){var i=o(r),u=o(n);return Math.sqrt(t.reduce((function(r,n,t){var o=e[n]?e[n](i,u):i[n]-u[n];return r+(a[t]||0)*Math.pow(isNaN(o)?0:o,2)}),0))}},yr=function(r){var a=r.reduce((function(r,a){if(void 0!==a){var n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r}),{sin:0,cos:0});return 180*Math.atan2(a.sin,a.cos)/Math.PI},xr=function(r){var a=r.filter((function(r){return void 0!==r}));return a.length?a.reduce((function(r,a){return r+a}),0)/a.length:void 0},wr=function(r){return"function"==typeof r};var zr={mode:"hsl",output:{rgb:function(r){var a=r.h,n=r.s,t=r.l,e=r.alpha;a=nr(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){var a=r.match(d)||r.match(v);if(a){var n={mode:"hsl",h:void 0===a[3]?tr(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]),n}}],serialize:function(r){return"hsl("+(r.h||0)+" "+100*r.s+"% "+100*r.l+"%"+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},s:k,l:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};function kr(r){var a=r.h,n=r.s,t=r.v,e=r.alpha;a=nr(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 Pr(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 qr={mode:"hsv",output:{rgb:kr},parsers:["--hsv"],serialize:"color(--hsv ",input:{rgb:Pr},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:or},s:k,v:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};var Ir={mode:"hsi",output:{rgb:function(r){var a=r.h,n=r.s,t=r.i,e=r.alpha;a=nr(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}},parsers:["--hsi"],serialize:"color(--hsi ",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:k,fixup:or},s:k,i:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};var jr,Er={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 kr({h:a,s:1===t?1:1-n/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var a=Pr(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){var a=r.match(g);if(a){var n={mode:"hwb",h:void 0===a[3]?tr(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]),n}}],serialize:function(r){return"hwb("+(r.h||0)+" "+100*r.w+"% "+100*r.b+"%"+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},w:k,b:k,alpha:{use:k,fixup:P}},difference:{h:gr},average:{h:yr}},Sr=function(r){var a=Math.pow(r/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*a)/(1+18.6875*a),134.03437499999998)||0},Or=function(r){return Math.max(203*r,0)},Cr=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha;a=Or(a),n=Or(n);var o=1.15*a-.15*(t=Or(t)),i=.66*n+.34*a,u=Sr(.41478972*o+.579999*i+.014648*t),h=Sr(-.20151*o+1.120649*i+.0531008*t),l=Sr(-.0166008*o+.2648*i+.6684799*t),c=(u+h)/2,s={mode:"jab",j:.44*c/(1-.56*c)-16295499532821565e-27,a:3.524*u-4.066708*h+.542708*l,b:.199076*u+1.096799*h-1.295875*l};return void 0!==e&&(s.alpha=e),s},Rr=16295499532821565e-27,Ar=function(r){var a=Math.pow(r,.007460772656268216);return 1e4*Math.pow((.8359375-a)/(18.6875*a-18.8515625),6.277394636015326)||0},Hr=function(r){return r/203},Nr=function(r){var a=r.j,n=r.a,t=r.b,e=r.alpha,o=(a+Rr)/(.44+.56*(a+Rr)),i=Ar(o+.13860504*n+.058047316*t),u=Ar(o-.13860504*n-.058047316*t),h=Ar(o-.096019242*n-.8118919*t),l={mode:"xyz65",x:Hr(1.661373024652174*i-.914523081304348*u+.23136208173913045*h),y:Hr(-.3250758611844533*i+1.571847026732543*u-.21825383453227928*h),z:Hr(-.090982811*i-.31272829*u+1.5227666*h)};return void 0!==e&&(l.alpha=e),l},$r=function(r){var a=Cr(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},Dr=function(r){return $(Nr(r))},Lr={mode:"jab",channels:["j","a","b","alpha"],parsers:["--jzazbz"],serialize:"color(--jzazbz ",input:{rgb:$r,xyz65:Cr},output:{rgb:Dr,xyz65:Nr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:k,a:k,b:k,alpha:{use:k,fixup:P}}},Tr=function(r){var a=r.j,n=r.a,t=r.b,e=r.alpha,o=Math.sqrt(n*n+t*t),i={mode:"jch",j:a,c:o};return o&&(i.h=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},Br=function(r){var a=r.j,n=r.c,t=r.h,e=r.alpha,o={mode:"jab",j: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},Fr={mode:"jch",parsers:["--jzczhz"],serialize:"color(--jzczhz ",output:{jab:Br,rgb:function(r){return Dr(Br(r))}},input:{rgb:function(r){return Tr($r(r))},jab:Tr},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:k,fixup:or},c:k,j:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Gr=.96422,Wr=.82521,_r=Math.pow(29,3)/Math.pow(3,3),Kr=Math.pow(6,3)/Math.pow(29,3),Jr=function(r){return Math.pow(r,3)>Kr?Math.pow(r,3):(116*r-16)/_r},Qr=function(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:Jr(n/500+o)*Gr,y:1*Jr(o),z:Jr(i)*Wr};return void 0!==e&&(u.alpha=e),u},Ur=function(r){return K(Qr(r))},Vr=function(r){return r>Kr?Math.cbrt(r):(_r*r+16)/116},Xr=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=Vr(a/Gr),i=Vr(n/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-Vr(t/Wr))};return void 0!==e&&(u.alpha=e),u},Yr=function(r){var a=Xr(J(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},Zr={mode:"lab",output:{xyz:Qr,rgb:Ur},input:{xyz:Xr,rgb:Yr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.287,93.55],b:[-112.029,93.388]},parsers:[function(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}}],serialize:function(r){return"lab("+r.l+"% "+r.a+" "+r.b+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:P}}},ra=.95047,aa=1.08883,na=Math.pow(29,3)/Math.pow(3,3),ta=Math.pow(6,3)/Math.pow(29,3),ea=function(r){return Math.pow(r,3)>ta?Math.pow(r,3):(116*r-16)/na},oa=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=(a+16)/116,i=o-t/200,u={mode:"xyz65",x:ea(n/500+o)*ra,y:1*ea(o),z:ea(i)*aa};return void 0!==e&&(u.alpha=e),u},ia=function(r){return $(oa(r))},ua=function(r){return r>ta?Math.cbrt(r):(na*r+16)/116},ha=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=ua(a/ra),i=ua(n/1),u={mode:"lab65",l:116*i-16,a:500*(o-i),b:200*(i-ua(t/aa))};return void 0!==e&&(u.alpha=e),u},la=function(r){var a=ha(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},ca=Object.assign({},Zr,{mode:"lab65",parsers:["--lab-d65"],serialize:"color(--lab-d65 ",output:{xyz65:oa,rgb:ia},input:{xyz65:ha,rgb:la},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}}),sa=function(r,a){var n=r.l,t=r.a,e=r.b,o=r.alpha;void 0===a&&(a="lch");var i=Math.sqrt(t*t+e*e),u={mode:a,l:n,c:i};return i&&(u.h=nr(180*Math.atan2(e,t)/Math.PI)),void 0!==o&&(u.alpha=o),u},pa=function(r,a){var n=r.l,t=r.c,e=r.h,o=r.alpha;void 0===a&&(a="lab");var i={mode:a,l:n,a:t?t*Math.cos(e/180*Math.PI):0,b:t?t*Math.sin(e/180*Math.PI):0};return void 0!==o&&(i.alpha=o),i},fa={mode:"lch",output:{lab:pa,rgb:function(r){return Ur(pa(r))}},input:{rgb:function(r){return sa(Yr(r))},lab:sa},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.207],h:[0,360]},parsers:[function(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]?tr(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}}],serialize:function(r){return"lch("+r.l+"% "+r.c+" "+(r.h||0)+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},c:k,l:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},da=Object.assign({},fa,{mode:"lch65",parsers:["--lch-d65"],serialize:"color(--lch-d65 ",output:{lab65:function(r){return pa(r,"lab65")},rgb:function(r){return ia(pa(r,"lab65"))}},input:{rgb:function(r){return sa(la(r),"lch65")},lab65:function(r){return sa(r,"lch65")}},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}}),va=function(r,a,n){return 4*r/(r+15*a+3*n)},ba=function(r,a,n){return 9*a/(r+15*a+3*n)},ga=va(Gr,1,Wr),Ma=ba(Gr,1,Wr),ma=function(r){var a,n=r.x,t=r.y,e=r.z,o=r.alpha,i=(a=t/1)<=Kr?_r*a:116*Math.cbrt(a)-16,u=va(n,t,e),h=ba(n,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-ga),h=13*i*(h-Ma)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l},ya=function(r){return ma(J(r))},xa=4*(jr=Gr)/(jr+15*1+3*Wr),wa=function(r,a,n){return 9*a/(r+15*a+3*n)}(Gr,1,Wr),za=function(r){var a=r.l,n=r.u,t=r.v,e=r.alpha,o=n/(13*a)+xa,i=t/(13*a)+wa,u=1*(a<=8?a/_r: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},ka=function(r){return K(za(r))},Pa={mode:"luv",output:{xyz:za,rgb:ka},input:{xyz:ma,rgb:ya},channels:["l","u","v","alpha"],parsers:["--luv"],serialize:"color(--luv ",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:k,u:k,v:k,alpha:{use:k,fixup:P}}},qa=function(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=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},Ia=function(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},ja={mode:"lchuv",output:{luv:Ia,rgb:function(r){return ka(Ia(r))}},input:{rgb:function(r){return qa(ya(r))},luv:qa},channels:["l","c","h","alpha"],parsers:["--lchuv"],serialize:"color(--lchuv ",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:k,fixup:or},c:k,l:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Ea=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Sa=Math.PI/180,Oa=180/Math.PI,Ca=Ea[3]*Ea[4],Ra=Ea[1]*Ea[4],Aa=Ea[1]*Ea[2]-Ea[0]*Ea[3],Ha={mode:"cubehelix",channels:["h","s","l","alpha"],parsers:["--cubehelix"],serialize:"color(--cubehelix ",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=(Aa*t+a*Ca-n*Ra)/(Aa+Ca-Ra),i=t-o,u=(Ea[4]*(n-o)-Ea[2]*i)/Ea[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(Ea[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*Oa-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)*Sa;var i=void 0===n?0:n*t*(1-t),u=Math.cos(a),h=Math.sin(a);return o.r=t+i*(Ea[0]*u+Ea[1]*h),o.g=t+i*(Ea[2]*u+Ea[3]*h),o.b=t+i*(Ea[4]*u+Ea[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:k,fixup:or},s:k,l:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}},Na=function(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=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},$a=26/180*Math.PI,Da=Math.cos($a),La=Math.sin($a),Ta=100/Math.log(1.39),Ba=function(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"lab65",l:(Math.exp(1*a/Ta)-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-$a),h=i*Math.sin(t/180*Math.PI-$a);o.a=u*Da-h/.83*La,o.b=u*La+h/.83*Da}return void 0!==e&&(o.alpha=e),o},Fa=function(r){return Ba(Na(r))},Ga=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=n*Da+t*La,i=.83*(t*Da-n*La),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:Ta/1*Math.log(1+.0039*a),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=nr((Math.atan2(i,o)+$a)/Math.PI*180)),void 0!==e&&(h.alpha=e),h},Wa=function(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},_a=function(r){return Wa(Ga(r))},Ka={mode:"dlab",parsers:["--din99o-lab"],serialize:"color(--din99o-lab ",output:{lab65:Fa,rgb:function(r){return ia(Fa(r))}},input:{lab65:_a,rgb:function(r){return _a(la(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:P}}},Ja={mode:"dlch",parsers:["--din99o-lch"],serialize:"color(--din99o-lch ",output:{lab65:Ba,dlab:Wa,rgb:function(r){return ia(Ba(r))}},input:{lab65:Ga,dlab:Na,rgb:function(r){return Ga(la(r))}},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:k,c:k,h:{use:k,fixup:or},alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Qa={mode:"xyz",parsers:["xyz","--xyz-d50"],serialize:"color(--xyz-d50 ",output:{rgb:K,lab:Xr},input:{rgb:J,lab:Qr},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:P}}},Ua={mode:"xyz65",serialize:"color(--xyz-d65 ",output:{rgb:$,xyz:function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"xyz",x:1.0478112*a+.0228866*n-.050127*t,y:.0295424*a+.9904844*n-.0170491*t,z:-.0092345*a+.0150436*n+.7521316*t};return void 0!==e&&(o.alpha=e),o}},input:{rgb:N,xyz:function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"xyz65",x:.9555766*a-.0230393*n+.0631636*t,y:-.0282895*a+1.0099416*n+.0210077*t,z:.0122982*a-.020483*n+1.3299098*t};return void 0!==e&&(o.alpha=e),o}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parsers:["--xyz-d65"],interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:P}}},Va={mode:"yiq",output:{rgb:function(r){var a=r.y,n=r.i,t=r.q,e=r.alpha;return S({r:a+.95608445*n+.6208885*t,g:a-.27137664*n-.6486059*t,b:a-1.10561724*n+1.70250126*t,alpha:e})}},input:{rgb:function(r){var a=j(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"],parsers:["--yiq"],serialize:"color(--yiq ",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:k,i:k,q:k,alpha:{use:k,fixup:P}}},Xa=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=Math.pow(a+.3963377774*n+.2158037573*t,3),i=Math.pow(a-.1055613458*n-.0638541728*t,3),u=Math.pow(a-.0894841775*n-1.291485548*t,3),h={mode:"lrgb",r:4.0767416621*o-3.3077115913*i+.2309699292*u,g:-1.2684380046*o+2.6097574011*i-.3413193965*u,b:-.0041960863*o-.7034186147*i+1.707614701*u};return void 0!==e&&(h.alpha=e),h},Ya=function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.cbrt(.4122214708*a+.5363325363*n+.0514459929*t),i=Math.cbrt(.2119034982*a+.6806995451*n+.1073969566*t),u=Math.cbrt(.0883024619*a+.2817188376*n+.6299787005*t),h={mode:"oklab",l:.2104542553*o+.793617785*i-.0040720468*u,a:1.9779984951*o-2.428592205*i+.4505937099*u,b:.0259040371*o+.7827717662*i-.808675766*u};return void 0!==e&&(h.alpha=e),h},Za=function(r){var a=Ya(j(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},rn=function(r){return S(Xa(r))},an=Object.assign({},Zr,{mode:"oklab",output:{lrgb:Xa,rgb:rn},input:{lrgb:Ya,rgb:Za},ranges:{l:[0,.999],a:[-.233,.276],b:[-.311,.198]},parsers:["--oklab"],serialize:"color(--oklab "}),nn=Object.assign({},fa,{mode:"oklch",output:{oklab:function(r){return pa(r,"oklab")},rgb:function(r){return rn(pa(r,"oklab"))}},input:{rgb:function(r){return sa(Za(r),"oklch")},oklab:function(r){return sa(r,"oklch")}},parsers:["--oklch"],serialize:"color(--oklch ",ranges:{l:[0,.999],c:[0,.322],h:[0,360]}}),tn=function(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}},en=vr("rgb"),on=vr("hsl"),un=tn(2),hn=function(r){return Math.max(0,Math.min(1,r))},ln=function(r){return Math.round(255*hn(r))},cn=function(r){var a=en(r);if(void 0!==a)return"#"+(1<<24|ln(a.r)<<16|ln(a.g)<<8|ln(a.b)).toString(16).slice(1)},sn=function(r){var a=en(r);if(void 0!==a){var n=ln(a.r),t=ln(a.g),e=ln(a.b);return void 0===a.alpha||1===a.alpha?"rgb("+n+", "+t+", "+e+")":"rgba("+n+", "+t+", "+e+", "+un(hn(a.alpha))+")"}},pn=function(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))}},fn=function(r,a,n){void 0===a&&(a="rgb"),void 0===n&&(n=!1);var t=a?pr(a).channels:null,e=a?vr(a):dr;return function(o){var i=e(o),u=(t||pr(o.mode).channels).reduce((function(n,t){var e=r(i[t],t,i,a);return void 0===e||isNaN(e)||(n[t]=e),n}),{mode:a});if(!n)return u;var h=dr(o);return h&&h.mode!==u.mode?vr(h.mode)(u):u}},dn=function(r,a,n){return"alpha"!==a?(r||0)*(void 0!==n.alpha?n.alpha:1):r},vn=function(r,a,n){return"alpha"!==a&&0!==n.alpha?(r||0)/(void 0!==n.alpha?n.alpha:1):r},bn=function(r,a){return void 0===r&&(r=1),void 0===a&&(a=0),function(n,t){return"alpha"!==t?n*r+a:n}},gn=function(r){return"function"==typeof r},Mn=function(r){return r&&"object"==typeof r},mn=function(r){return"number"==typeof r},yn=function(r,a,n,t){void 0===a&&(a="rgb");var e=pr(a),o=vr(a),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):mn(r)||gn(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=Mn(n)&&Mn(n[a])&&n[a].fixup?n[a].fixup:Mn(e.interpolate[a])&&e.interpolate[a].fixup?e.interpolate[a].fixup:function(r){return r},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 s=e.channels.reduce((function(r,a){var t;return gn(n)?t=n:Mn(n)&&gn(n[a])?t=n[a]:Mn(n)&&Mn(n[a])&&n[a].use?t=n[a].use:gn(e.interpolate[a])?t=e.interpolate[a]:Mn(e.interpolate[a])&&(t=e.interpolate[a].use),r[a]=t(l[a]),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 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&&(mn(c)&&(c=pn((c-t)/o)),l=c(l));var f=(n-1+l)/p;return e.channels.reduce((function(r,a){var n=s[a](f);return void 0!==n&&(r[a]=n),r}),{mode:a})}},xn=function(r,a){return function(n,t,e){void 0===t&&(t="rgb");var o=a?fn(a,t):void 0,i=yn(n,t,e,r);return o?function(r){return o(i(r))}:i}},wn=xn(dn,vn),zn=function(r){return(1-Math.cos(r*Math.PI))/2},kn=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},Pn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return kn(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)}},qn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return kn(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(a-t/n)*n)}},In=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},jn=function(r){return Pn(In(r))},En=function(r){return qn(In(r))},Sn=Math.sign,On=Math.min,Cn=Math.abs,Rn=function(r){for(var a=r.length-1,n=[],t=[],e=[],o=0;o<a;o++)n.push((r[o+1]-r[o])*a),t.push(o>0?.5*(r[o+1]-r[o-1])*a:void 0),e.push(o>0?(Sn(n[o-1])+Sn(n[o]))*On(Cn(n[o-1]),Cn(n[o]),.5*Cn(t[o])):void 0);return[n,t,e]},An=function(r,a,n){var t=r.length-1,e=t*t;return function(o){var i;1===o?(i=t-1,o=1):i=Math.floor(o*t);var u=o-i/t,h=u*u,l=h*u;return(a[i]+a[i+1]-2*n[i])*e*l+(3*n[i]-2*a[i]-a[i+1])*t*h+a[i]*u+r[i]}},Hn=function(r){if(r.length<3)return k(r);var a=r.length-1,n=Rn(r),t=n[0],e=n[2];return e[0]=t[0],e[a]=t[a-1],An(r,e,t)},Nn=function(r){var a=r.length-1,n=Rn(r),t=n[0],e=n[1],o=n[2];e[0]=.5*(r[1]-r[a])*a,e[a]=.5*(r[0]-r[a-1])*a;var i=(r[0]-r[a])*a,u=i;return o[0]=(Sn(i)+Sn(t[0]))*On(Cn(i),Cn(t[0]),.5*Cn(e[0])),o[a]=(Sn(t[a-1])+Sn(u))*On(Cn(t[a-1]),Cn(u),.5*Cn(e[a])),An(r,o,t)},$n=vr("rgb"),Dn=function(r){var a=$n(r);return void 0!==a&&a.r>=0&&a.r<=1&&a.g>=0&&a.g<=1&&a.b>=0&&a.b<=1},Ln=vr("rgb"),Tn=function(r){var a=Ln(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},Bn=function(r){return void 0===(r=dr(r))||Dn(r)?r:vr(r.mode)(Tn(r))},Fn=function(r,a){if(void 0===a&&(a="lch"),void 0===(r=dr(r))||Dn(r))return r;var n=vr(r.mode);r=vr(a)(r);var t=Object.assign({},r,{c:0});if(!Dn(t))return n(Tn(t));for(var e,o=0,i=r.c,u=pr(a).ranges.c,h=(u[1]-u[0])/Math.pow(2,13);i-o>h;)t.c=o+.5*(i-o),Dn(t)?(e=t.c,o=t.c):i=t.c;return n(Dn(t)?t:Object.assign({},t,{c:e}))},Gn={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 Wn(r){var a=vr("lrgb")(r);return.2126*a.r+.7152*a.g+.0722*a.b}var _n=vr("rgb"),Kn=[[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]],Jn=[[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]],Qn=[[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]],Un=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 x(o[a],i[a],e)}))}return function(r){var a=dr(r);if(void 0!==a){var n=_n(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),vr(a.mode)(u)}}},Vn=function(r){return void 0===r&&(r=1),Un(Kn,r)},Xn=function(r){return void 0===r&&(r=1),Un(Jn,r)},Yn=function(r){return void 0===r&&(r=1),Un(Qn,r)},Zn=function(r){return Math.max(r,0)},rt=function(r){return Math.max(Math.min(r,1),0)},at=function(r,a,n){void 0===n&&(n=!1);var t=vr(a),e=pr(a).channels;return function(o){var i=t(o);if(i){for(var u,h={mode:a},l=e.length,c=0;c<r.length;c++)void 0!==i[u=e[Math.floor(c/l)]]&&(h[u]=(h[u]||0)+r[c]*(i[e[c%l]]||0));if(!n)return h;var s=dr(o);return s&&h.mode!==s.mode?vr(s.mode)(h):h}}};sr(D),sr(Ha),sr(Ka),sr(Ja),sr(Ir),sr(zr),sr(qr),sr(Er),sr(Lr),sr(Fr),sr(Zr),sr(ca),sr(fa),sr(da),sr(ja),sr(O),sr(Pa),sr(B),sr(Q),sr(ar),sr(q),sr(Ua),sr(Qa),sr(Va),sr(an),sr(nn);var nt=vr("a98"),tt=vr("cubehelix"),et=vr("dlab"),ot=vr("dlch"),it=vr("hsi"),ut=vr("hsl"),ht=vr("hsv"),lt=vr("hwb"),ct=vr("jab"),st=vr("jch"),pt=vr("lab"),ft=vr("lab65"),dt=vr("lch"),vt=vr("lch65"),bt=vr("lchuv"),gt=vr("lrgb"),Mt=vr("luv"),mt=vr("p3"),yt=vr("prophoto"),xt=vr("rec2020"),wt=vr("rgb"),zt=vr("xyz"),kt=vr("xyz65"),Pt=vr("yiq"),qt=vr("oklab"),It=vr("oklch");r.a98=nt,r.average=function(r,a,n){void 0===a&&(a="rgb");var t=pr(a),e=r.map(vr(a));return t.channels.reduce((function(r,a){var o,i=e.map((function(r){return r[a]})).filter((function(r){return void 0!==r}));i.length&&(o=wr(n)?n:n&&wr(n[a])?n[a]:t.average&&wr(t.average[a])?t.average[a]:xr,r[a]=o(i,a));return r}),{mode:a})},r.averageAngle=yr,r.averageNumber=xr,r.blend=function(r,a,n){void 0===a&&(a="normal"),void 0===n&&(n="rgb");var t="function"==typeof a?a:Gn[a],e=vr(n),o=pr(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 Bn;case"lch":return Fn}},r.clampChroma=Fn,r.clampRgb=Bn,r.colorsNamed=n,r.converter=vr,r.cubehelix=tt,r.deficiencyDeuter=Xn,r.deficiencyProt=Vn,r.deficiencyTrit=Yn,r.defineMode=sr,r.differenceCie76=function(){return mr("lab65")},r.differenceCie94=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=.045),void 0===n&&(n=.015);var t=vr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),p=u.l,f=u.a,d=u.b,v=Math.sqrt(f*f+d*d),b=Math.pow(h-p,2),g=Math.pow(s-v,2),M=Math.pow(l-f,2)+Math.pow(c-d,2)-g;return Math.sqrt(b/Math.pow(r,2)+g/Math.pow(1+a*s,2)+M/Math.pow(1+n*s,2))}},r.differenceCiede2000=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=1);var t=vr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),p=u.l,f=u.a,d=u.b,v=(s+Math.sqrt(f*f+d*d))/2,b=.5*(1-Math.sqrt(Math.pow(v,7)/(Math.pow(v,7)+Math.pow(25,7)))),g=l*(1+b),M=f*(1+b),m=Math.sqrt(g*g+c*c),y=Math.sqrt(M*M+d*d),x=Math.abs(g)+Math.abs(c)===0?0:Math.atan2(c,g);x+=2*(x<0)*Math.PI;var w=Math.abs(M)+Math.abs(d)===0?0:Math.atan2(d,M);w+=2*(w<0)*Math.PI;var z=p-h,k=y-m,P=m*y==0?0:w-x;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var q,I=2*Math.sqrt(m*y)*Math.sin(P/2),j=(h+p)/2,E=(m+y)/2;m*y==0?q=x+w:(q=(x+w)/2,q-=(Math.abs(x-w)>Math.PI)*Math.PI,q+=2*(q<0)*Math.PI);var S=Math.pow(j-50,2),O=1-.17*Math.cos(q-Math.PI/6)+.24*Math.cos(2*q)+.32*Math.cos(3*q+Math.PI/30)-.2*Math.cos(4*q-63*Math.PI/180),C=1+.015*S/Math.sqrt(20+S),R=1+.045*E,A=1+.015*E*O,H=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*q-275)/25,2)),N=2*Math.sqrt(Math.pow(E,7)/(Math.pow(E,7)+Math.pow(25,7))),$=-1*Math.sin(2*H)*N;return Math.sqrt(Math.pow(z/(r*C),2)+Math.pow(k/(a*R),2)+Math.pow(I/(n*A),2)+$*k/(a*R)*I/(n*A))}},r.differenceCmc=function(r,a){void 0===r&&(r=1),void 0===a&&(a=1);var n=vr("lab65");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 s=n(e),p=s.l,f=s.a,d=s.b,v=Math.sqrt(f*f+d*d),b=Math.pow(i-p,2),g=Math.pow(l-v,2),M=Math.pow(u-f,2)+Math.pow(h-d,2)-g,m=Math.sqrt(Math.pow(l,4)/(Math.pow(l,4)+1900)),y=i<16?.511:.040975*i/(1+.01765*i),x=.0638*l/(1+.0131*l)+.638,w=x*(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(r*y,2)+g/Math.pow(a*x,2)+M/Math.pow(w,2))}},r.differenceDin99o=function(){return mr("dlab")},r.differenceEuclidean=mr,r.differenceHueChroma=Mr,r.differenceHueNaive=gr,r.differenceHueSaturation=br,r.differenceHyab=function(){var r=vr("lab65");return function(a,n){var t=r(a),e=r(n),o=t.l-e.l,i=t.a-e.a,u=t.b-e.b;return Math.abs(o)+Math.sqrt(i*i+u*u)}},r.differenceKotsarenkoRamos=function(){return mr("yiq",[.5053,.299,.1957])},r.displayable=Dn,r.dlab=et,r.dlch=ot,r.easingGamma=w,r.easingInOutSine=zn,r.easingMidpoint=pn,r.easingSmootherstep=function(r){return r*r*r*(r*(6*r-15)+10)},r.easingSmoothstep=function(r){return r*r*(3-2*r)},r.filterBrightness=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=Zn(r);return fn(bn(n),a,!0)},r.filterContrast=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=Zn(r);return fn(bn(n,(1-n)/2),a,!0)},r.filterDeficiencyDeuter=Xn,r.filterDeficiencyProt=Vn,r.filterDeficiencyTrit=Yn,r.filterGrayscale=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),at([.2126+.7874*(n=1-rt(r)),.7152-.7152*n,.0722-.0722*n,0,.2126-.2126*n,.7152+.2848*n,.0722-.0722*n,0,.2126-.2126*n,.7152-.7152*n,.0722+.9278*n,0,0,0,0,1],a,!0);var n},r.filterHueRotate=function(r,a){return void 0===r&&(r=0),void 0===a&&(a="rgb"),at(function(r){var a=Math.PI*r/180,n=Math.cos(a),t=Math.sin(a);return[.213+.787*n-.213*t,.715-.715*n-.715*t,.072-.072*n+.928*t,0,.213-.213*n+.143*t,.715+.285*n+.14*t,.072-.072*n-.283*t,0,.213-.213*n-.787*t,.715-.715*n+.715*t,.072+.928*n+.072*t,0,0,0,0,1]}(r),a,!0)},r.filterInvert=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=rt(r);return fn((function(r,a){return"alpha"===a?r:function(r,a,n){return void 0===r||void 0===a?void 0:r+n*(a-r)}(n,1-n,r)}),a,!0)},r.filterSaturate=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),at(function(r){var a=Zn(r);return[.213+.787*a,.715-.715*a,.072-.072*a,0,.213-.213*a,.715+.285*a,.072-.072*a,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,1]}(r),a,!0)},r.filterSepia=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),at([.393+.607*(n=1-rt(r)),.769-.769*n,.189-.189*n,0,.349-.349*n,.686+.314*n,.168-.168*n,0,.272-.272*n,.534-.534*n,.131+.869*n,0,0,0,0,1],a,!0);var n},r.fixupAlpha=P,r.fixupHueDecreasing=function(r){return er(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return er(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return er(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=or,r.formatCss=function(r){var a=dr(r);if(a){var n=pr(a.mode);if(!n.serialize||"string"==typeof n.serialize){var t=n.serialize||"color(--"+a.mode+" ";return n.channels.forEach((function(r,n){"alpha"!==r&&(t+=(n?" ":"")+(a[r]||0))})),void 0!==a.alpha&&a.alpha<1&&(t+=" / "+a.alpha),t+")"}return"function"==typeof n.serialize?n.serialize(a):void 0}},r.formatHex=cn,r.formatHex8=function(r){var a=en(r);if(void 0!==a){var n=ln(void 0!==a.alpha?a.alpha:1);return cn(a)+(256|n).toString(16).slice(1)}},r.formatHsl=function(r){var a=on(r);if(void 0!==a){var n=un(a.h||0),t=un(100*hn(a.s)),e=un(100*hn(a.l));return void 0===a.alpha||1===a.alpha?"hsl("+n+", "+t+"%, "+e+"%)":"hsla("+n+", "+t+"%, "+e+"%, "+un(hn(a.alpha))+")"}},r.formatRgb=sn,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return sn;case"hex":return cn}},r.getModeDefinition=pr,r.hsi=it,r.hsl=ut,r.hsv=ht,r.hwb=lt,r.interpolate=function(r,a,n){return void 0===a&&(a="rgb"),yn(r,a,n)},r.interpolateAlpha=P,r.interpolateCosine=function(r,a){return void 0===a&&(a=1),function(n){var t=w(a),e=z((function(r,a,n){return x(r,a,zn(n))}))((r||function(r){return r})(n));return function(r){return e(t(r))}}},r.interpolateHue=or,r.interpolateLinear=function(r,a){return void 0===a&&(a=1),function(n){var t=w(a);return function(a){return k((r||function(r){return r})(n))(t(a))}}},r.interpolateSplineBasis=function(r,a,n){return void 0===a&&(a="default"),void 0===n&&(n=1),function(t){var e=w(n);return"default"===a?function(a){return Pn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return qn((r||function(r){return r})(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=w(n);return"closed"===a?function(a){return Nn((r||function(r){return r})(t))(e(a))}:"default"===a?function(a){return Hn((r||function(r){return r})(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=w(n);return"default"===a?function(a){return jn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return En((r||function(r){return r})(t))(e(a))}:void 0}},r.interpolateWith=xn,r.interpolateWithPremultipliedAlpha=wn,r.interpolatorLinear=k,r.interpolatorPiecewise=z,r.interpolatorSplineBasis=Pn,r.interpolatorSplineBasisClosed=qn,r.interpolatorSplineMonotone=Hn,r.interpolatorSplineMonotone2=function(r){if(r.length<3)return k(r);var a=r.length-1,n=Rn(r),t=n[0],e=n[1],o=n[2];return e[0]=(2*r[1]-1.5*r[0]-.5*r[2])*a,e[a]=(1.5*r[a]-2*r[a-1]+.5*r[a-2])*a,o[0]=e[0]*t[0]<=0?0:Cn(e[0])>2*Cn(t[0])?2*t[0]:e[0],o[a]=e[a]*t[a-1]<=0?0:Cn(e[a])>2*Cn(t[a-1])?2*t[a-1]:e[a],An(r,o,t)},r.interpolatorSplineMonotoneClosed=Nn,r.interpolatorSplineNatural=jn,r.interpolatorSplineNaturalClosed=En,r.jab=ct,r.jch=st,r.lab=pt,r.lab65=ft,r.lch=dt,r.lch65=vt,r.lchuv=bt,r.lerp=x,r.lrgb=gt,r.luv=Mt,r.mapAlphaDivide=vn,r.mapAlphaMultiply=dn,r.mapTransferGamma=function(r,a,n){return void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=0),function(t,e){return"alpha"!==e?r*Math.pow(t,a)+n:t}},r.mapTransferLinear=bn,r.mapper=fn,r.nearest=function(r,a,n){void 0===a&&(a=mr()),void 0===n&&(n=function(r){return r});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.oklab=qt,r.oklch=It,r.p3=mt,r.parse=fr,r.prophoto=yt,r.random=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a={});var n=pr(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.rec2020=xt,r.rgb=wt,r.round=tn,r.samples=function(r,a){void 0===r&&(r=2),void 0===a&&(a=1);var n=w(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=Wn(r),t=Wn(a);return(Math.max(n,t)+.05)/(Math.min(n,t)+.05)},r.wcagLuminance=Wn,r.xyz=zt,r.xyz65=kt,r.yiq=Pt,Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((r="undefined"!=typeof globalThis?globalThis:r||self).culori={})}(this,(function(r){"use strict";var a=function(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},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},t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o="(?:"+t+"%|"+t+")",i="(?:"+t+"(deg|grad|rad|turn)|"+t+")",u="\\s*,\\s*",h="\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+u+t+u+t+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),s=new RegExp("^rgba?\\(\\s*"+e+u+e+u+e+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),d=new RegExp("^hsla?\\(\\s*"+i+u+e+u+e+"\\s*(?:,\\s*"+o+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+i+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+i+l+e+l+e+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+t+"%?"+l+t+l+t+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+t+"%?"+l+t+l+i+"\\s*(?:\\/\\s*"+o+"\\s*)?\\)$"),y=new RegExp("^color\\(\\s*([a-z0-9\\-]+)"+l+o+l+o+l+o+"\\s*(?:\\/"+h+o+"\\s*)?\\)$"),x=function(r,a,n){return r+n*(a-r)},w=function(r){return void 0===r&&(r=1),1===r?function(r){return r}:function(a){return Math.pow(a,r)}},z=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=a>=1?n.length-1:Math.max(Math.floor(t),0),o=n[e];return void 0===o?void 0:r(o[0],o[1],t-e)}}},k=z(x),P=function(r){var a=!1,n=r.map((function(r){return void 0!==r?(a=!0,r):1}));return a?n:r},q={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(r){var n;return(n=r.match(b))?a(parseInt(n[1],16),n[1].length):void 0},function(r){var a,n;if(a=r.match(c)||r.match(p))n={mode:"rgb",r:a[1]/255,g:a[2]/255,b:a[3]/255};else{if(!(a=r.match(s)||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 a(n[r.toLowerCase()],6)},function(r){return"transparent"===r?a(0,8):void 0},"srgb"],serialize:"color(srgb ",interpolate:{r:k,g:k,b:k,alpha:{use:k,fixup:P}}},I=function(r){var a=Math.abs(r);return a<.04045?r/12.92:(Math.sign(r)||1)*Math.pow((a+.055)/1.055,2.4)},j=function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o={mode:"lrgb",r:I(a),g:I(n),b:I(t)};return void 0!==e&&(o.alpha=e),o},E=function(r){var a=Math.abs(r);return a>.0031308?(Math.sign(r)||1)*(1.055*Math.pow(a,1/2.4)-.055):12.92*r},S=function(r,a){var n=r.r,t=r.g,e=r.b,o=r.alpha;void 0===a&&(a="rgb");var i={mode:a,r:E(n),g:E(t),b:E(e)};return void 0!==o&&(i.alpha=o),i},O=Object.assign({},q,{mode:"lrgb",output:{rgb:S},input:{rgb:j},parsers:["--srgb-linear"],serialize:"color(--srgb-linear "}),C=function(r){return Math.pow(Math.abs(r),563/256)*Math.sign(r)},R=function(r){var a=C(r.r),n=C(r.g),t=C(r.b),e={mode:"xyz65",x:.5766690429101305*a+.1855582379065463*n+.1882286462349947*t,y:.29734497525053605*a+.6273635662554661*n+.07529145849399788*t,z:.02703136138641234*a+.07068885253582723*n+.9913375368376388*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},A=function(r){return Math.pow(Math.abs(r),256/563)*Math.sign(r)},H=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"a98",r:A(2.0415879038107465*a-.5650069742788596*n-.34473135077832956*t),g:A(-.9692436362808795*a+1.8759675015077202*n+.04155505740717557*t),b:A(.013444280632031142*a-.11836239223101838*n+1.0151749943912054*t)};return void 0!==e&&(o.alpha=e),o},N=function(r){var a=j(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz65",x:.4124564*n+.3575761*t+.1804375*e,y:.2126729*n+.7151522*t+.072175*e,z:.0193339*n+.119192*t+.9503041*e};return void 0!==o&&(i.alpha=o),i},$=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({r:3.2404542*a-1.5371385*n-.4985314*t,g:-.969266*a+1.8760108*n+.041556*t,b:.0556434*a-.2040259*n+1.0572252*t});return void 0!==e&&(o.alpha=e),o},D=Object.assign({},q,{mode:"a98",parsers:["a98-rgb"],serialize:"color(a98-rgb ",input:{rgb:function(r){return H(N(r))},xyz65:H},output:{rgb:function(r){return $(R(r))},xyz65:R}}),L=function(r){var a=j(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz65",x:.4865709*n+.2656676*t+.1982172*e,y:.2289745*n+.6917385*t+.0792869*e,z:0*n+.0451133*t+1.0439443*e};return void 0!==o&&(i.alpha=o),i},T=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({r:2.4934969*a-.9313836*n-.4027107*t,g:-.8294889*a+1.762664*n+.0236246*t,b:.0358458*a-.0761723*n+.9568845*t},"p3");return void 0!==e&&(o.alpha=e),o},B=Object.assign({},q,{mode:"p3",parsers:["display-p3"],serialize:"color(display-p3 ",input:{rgb:function(r){return T(N(r))},xyz65:T},output:{rgb:function(r){return $(L(r))},xyz65:L}}),F=function(r){var a=Math.abs(r);return a>=1/512?Math.sign(r)*Math.pow(a,1/1.8):16*r},G=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"prophoto",r:F(1.3457989731028281*a-.25558010007997534*n-.05110628506753401*t),g:F(-.5446224939028347*a+1.5082327413132781*n+.02053603239147973*t),b:F(0*a+0*n+1.2119675456389454*t)};return void 0!==e&&(o.alpha=e),o},W=function(r){var a=Math.abs(r);return a>=16/512?Math.sign(r)*Math.pow(a,1.8):r/16},_=function(r){var a=W(r.r),n=W(r.g),t=W(r.b),e={mode:"xyz65",x:.7977604896723027*a+.13518583717574031*n+.0313493495815248*t,y:.2880711282292934*a+.7118432178101014*n+8565396060525902e-20*t,z:0*a+0*n+.8251046025104601*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},K=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=S({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},J=function(r){var a=j(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},Q=Object.assign({},q,{mode:"prophoto",parsers:["prophoto-rgb"],serialize:"color(prophoto-rgb ",input:{xyz:G,rgb:function(r){return G(J(r))}},output:{xyz:_,rgb:function(r){return K(_(r))}}}),U=1.09929682680944,V=function(r){var a=Math.abs(r);return a>.018053968510807?(Math.sign(r)||1)*(U*Math.pow(a,.45)-(U-1)):4.5*r},X=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"rec2020",r:V(1.7166511879712674*a-.35567078377639233*n-.25336628137365974*t),g:V(-.6666843518324892*a+1.6164812366349395*n+.01576854581391113*t),b:V(.017639857445310783*a-.042770613257808524*n+.9421031212354738*t)};return void 0!==e&&(o.alpha=e),o},Y=1.09929682680944,Z=function(r){var a=Math.abs(r);return a<.08124285829863151?r/4.5:(Math.sign(r)||1)*Math.pow((a+Y-1)/Y,1/.45)},rr=function(r){var a=Z(r.r),n=Z(r.g),t=Z(r.b),e={mode:"xyz65",x:.6369580483012914*a+.14461690358620832*n+.1688809751641721*t,y:.2627002120112671*a+.6779980715188708*n+.05930171646986196*t,z:0*a+.028072693049087428*n+1.060985057710791*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},ar=Object.assign({},q,{mode:"rec2020",input:{xyz:X,rgb:function(r){return X(N(r))}},output:{xyz:rr,rgb:function(r){return $(rr(r))}},parsers:["rec2020"],serialize:"color(rec2020 "}),nr=function(r){return(r%=360)<0?r+360:r};var tr=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}},er=function(r,a){return r.map((function(n,t,e){if(void 0===n)return n;var o=nr(n);return 0===t||void 0===r[t-1]?o:a(o-nr(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)}),[])},or=function(r){return er(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},ir={},ur={},hr=[],lr={},cr=function(r){return r},sr=function(r){ir[r.mode]=Object.assign(ir[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(a){ir[a]||(ir[a]={}),ir[a][r.mode]=r.input[a]})),r.ranges||(r.ranges={}),r.difference||(r.difference={}),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=cr)})),ur[r.mode]=r,(r.parsers||[]).forEach((function(a){"function"==typeof a?hr.push(a):"string"==typeof a&&(lr[a]=r.mode)}))},pr=function(r){return ur[r]},fr=function(r){if("string"==typeof r){for(var a=void 0,n=0,t=hr.length;n<t&&void 0===(a=hr[n++](r)););return a||function(r){var a=r.match(y);if(a){var n=lr[a[1]];if(n){var t={mode:n},e=2;return pr(n).channels.forEach((function(r){void 0===a[e]&&void 0===a[e+1]||(t[r]=void 0!==a[e]?a[e]/100:+a[e+1]),e+=2})),t}}}(r)}},dr=function(r,a){return void 0===r?void 0:"object"!=typeof r?fr(r):void 0!==r.mode?r:a?Object.assign({},r,{mode:a}):void 0},vr=function(r){return void 0===r&&(r="rgb"),function(a){return void 0!==(a=dr(a,r))?a.mode===r?a:ir[a.mode][r]?ir[a.mode][r](a):"rgb"===r?ir[a.mode].rgb(a):ir.rgb[r](ir[a.mode].rgb(a)):void 0}},br=function(r,a){if(void 0===r.h||void 0===a.h||!r.s||!a.s)return 0;var n=nr(r.h),t=nr(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*a.s)*e},gr=function(r,a){if(void 0===r.h||void 0===a.h)return 0;var n=nr(r.h),t=nr(a.h);return Math.abs(t-n)>180?n-(t-360*Math.sign(t-n)):t-n},Mr=function(r,a){if(void 0===r.h||void 0===a.h||!r.c||!a.c)return 0;var n=nr(r.h),t=nr(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.c*a.c)*e},mr=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a=[1,1,1,0]);var n=pr(r),t=n.channels,e=n.difference,o=vr(r);return function(r,n){var i=o(r),u=o(n);return Math.sqrt(t.reduce((function(r,n,t){var o=e[n]?e[n](i,u):i[n]-u[n];return r+(a[t]||0)*Math.pow(isNaN(o)?0:o,2)}),0))}},yr=function(r){var a=r.reduce((function(r,a){if(void 0!==a){var n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r}),{sin:0,cos:0});return 180*Math.atan2(a.sin,a.cos)/Math.PI},xr=function(r){var a=r.filter((function(r){return void 0!==r}));return a.length?a.reduce((function(r,a){return r+a}),0)/a.length:void 0},wr=function(r){return"function"==typeof r};var zr={mode:"hsl",output:{rgb:function(r){var a=r.h,n=r.s,t=r.l,e=r.alpha;a=nr(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){var a=r.match(d)||r.match(v);if(a){var n={mode:"hsl",h:void 0===a[3]?tr(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]),n}}],serialize:function(r){return"hsl("+(r.h||0)+" "+100*r.s+"% "+100*r.l+"%"+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},s:k,l:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};function kr(r){var a=r.h,n=r.s,t=r.v,e=r.alpha;a=nr(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 Pr(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 qr={mode:"hsv",output:{rgb:kr},parsers:["--hsv"],serialize:"color(--hsv ",input:{rgb:Pr},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:or},s:k,v:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};var Ir={mode:"hsi",output:{rgb:function(r){var a=r.h,n=r.s,t=r.i,e=r.alpha;a=nr(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}},parsers:["--hsi"],serialize:"color(--hsi ",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:k,fixup:or},s:k,i:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}};var jr,Er={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 kr({h:a,s:1===t?1:1-n/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var a=Pr(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){var a=r.match(g);if(a){var n={mode:"hwb",h:void 0===a[3]?tr(a[1],a[2]):+a[3],w:a[4]/100,b:a[5]/100};return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=+a[7]),n}}],serialize:function(r){return"hwb("+(r.h||0)+" "+100*r.w+"% "+100*r.b+"%"+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},w:k,b:k,alpha:{use:k,fixup:P}},difference:{h:gr},average:{h:yr}},Sr=function(r){var a=Math.pow(r/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*a)/(1+18.6875*a),134.03437499999998)||0},Or=function(r){return Math.max(203*r,0)},Cr=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha;a=Or(a),n=Or(n);var o=1.15*a-.15*(t=Or(t)),i=.66*n+.34*a,u=Sr(.41478972*o+.579999*i+.014648*t),h=Sr(-.20151*o+1.120649*i+.0531008*t),l=Sr(-.0166008*o+.2648*i+.6684799*t),c=(u+h)/2,s={mode:"jab",j:.44*c/(1-.56*c)-16295499532821565e-27,a:3.524*u-4.066708*h+.542708*l,b:.199076*u+1.096799*h-1.295875*l};return void 0!==e&&(s.alpha=e),s},Rr=16295499532821565e-27,Ar=function(r){var a=Math.pow(r,.007460772656268216);return 1e4*Math.pow((.8359375-a)/(18.6875*a-18.8515625),6.277394636015326)||0},Hr=function(r){return r/203},Nr=function(r){var a=r.j,n=r.a,t=r.b,e=r.alpha,o=(a+Rr)/(.44+.56*(a+Rr)),i=Ar(o+.13860504*n+.058047316*t),u=Ar(o-.13860504*n-.058047316*t),h=Ar(o-.096019242*n-.8118919*t),l={mode:"xyz65",x:Hr(1.661373024652174*i-.914523081304348*u+.23136208173913045*h),y:Hr(-.3250758611844533*i+1.571847026732543*u-.21825383453227928*h),z:Hr(-.090982811*i-.31272829*u+1.5227666*h)};return void 0!==e&&(l.alpha=e),l},$r=function(r){var a=Cr(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},Dr=function(r){return $(Nr(r))},Lr={mode:"jab",channels:["j","a","b","alpha"],parsers:["--jzazbz"],serialize:"color(--jzazbz ",input:{rgb:$r,xyz65:Cr},output:{rgb:Dr,xyz65:Nr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:k,a:k,b:k,alpha:{use:k,fixup:P}}},Tr=function(r){var a=r.j,n=r.a,t=r.b,e=r.alpha,o=Math.sqrt(n*n+t*t),i={mode:"jch",j:a,c:o};return o&&(i.h=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},Br=function(r){var a=r.j,n=r.c,t=r.h,e=r.alpha,o={mode:"jab",j: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},Fr={mode:"jch",parsers:["--jzczhz"],serialize:"color(--jzczhz ",output:{jab:Br,rgb:function(r){return Dr(Br(r))}},input:{rgb:function(r){return Tr($r(r))},jab:Tr},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:k,fixup:or},c:k,j:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Gr=.96422,Wr=.82521,_r=Math.pow(29,3)/Math.pow(3,3),Kr=Math.pow(6,3)/Math.pow(29,3),Jr=function(r){return Math.pow(r,3)>Kr?Math.pow(r,3):(116*r-16)/_r},Qr=function(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:Jr(n/500+o)*Gr,y:1*Jr(o),z:Jr(i)*Wr};return void 0!==e&&(u.alpha=e),u},Ur=function(r){return K(Qr(r))},Vr=function(r){return r>Kr?Math.cbrt(r):(_r*r+16)/116},Xr=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=Vr(a/Gr),i=Vr(n/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-Vr(t/Wr))};return void 0!==e&&(u.alpha=e),u},Yr=function(r){var a=Xr(J(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},Zr={mode:"lab",output:{xyz:Qr,rgb:Ur},input:{xyz:Xr,rgb:Yr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.287,93.55],b:[-112.029,93.388]},parsers:[function(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}}],serialize:function(r){return"lab("+r.l+"% "+r.a+" "+r.b+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:P}}},ra=.95047,aa=1.08883,na=Math.pow(29,3)/Math.pow(3,3),ta=Math.pow(6,3)/Math.pow(29,3),ea=function(r){return Math.pow(r,3)>ta?Math.pow(r,3):(116*r-16)/na},oa=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=(a+16)/116,i=o-t/200,u={mode:"xyz65",x:ea(n/500+o)*ra,y:1*ea(o),z:ea(i)*aa};return void 0!==e&&(u.alpha=e),u},ia=function(r){return $(oa(r))},ua=function(r){return r>ta?Math.cbrt(r):(na*r+16)/116},ha=function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=ua(a/ra),i=ua(n/1),u={mode:"lab65",l:116*i-16,a:500*(o-i),b:200*(i-ua(t/aa))};return void 0!==e&&(u.alpha=e),u},la=function(r){var a=ha(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},ca=Object.assign({},Zr,{mode:"lab65",parsers:["--lab-d65"],serialize:"color(--lab-d65 ",output:{xyz65:oa,rgb:ia},input:{xyz65:ha,rgb:la},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}}),sa=function(r,a){var n=r.l,t=r.a,e=r.b,o=r.alpha;void 0===a&&(a="lch");var i=Math.sqrt(t*t+e*e),u={mode:a,l:n,c:i};return i&&(u.h=nr(180*Math.atan2(e,t)/Math.PI)),void 0!==o&&(u.alpha=o),u},pa=function(r,a){var n=r.l,t=r.c,e=r.h,o=r.alpha;void 0===a&&(a="lab");var i={mode:a,l:n,a:t?t*Math.cos(e/180*Math.PI):0,b:t?t*Math.sin(e/180*Math.PI):0};return void 0!==o&&(i.alpha=o),i},fa={mode:"lch",output:{lab:pa,rgb:function(r){return Ur(pa(r))}},input:{rgb:function(r){return sa(Yr(r))},lab:sa},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.207],h:[0,360]},parsers:[function(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]?tr(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}}],serialize:function(r){return"lch("+r.l+"% "+r.c+" "+(r.h||0)+(r.alpha<1?" / "+r.alpha:"")+")"},interpolate:{h:{use:k,fixup:or},c:k,l:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},da=Object.assign({},fa,{mode:"lch65",parsers:["--lch-d65"],serialize:"color(--lch-d65 ",output:{lab65:function(r){return pa(r,"lab65")},rgb:function(r){return ia(pa(r,"lab65"))}},input:{rgb:function(r){return sa(la(r),"lch65")},lab65:function(r){return sa(r,"lch65")}},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}}),va=function(r,a,n){return 4*r/(r+15*a+3*n)},ba=function(r,a,n){return 9*a/(r+15*a+3*n)},ga=va(Gr,1,Wr),Ma=ba(Gr,1,Wr),ma=function(r){var a,n=r.x,t=r.y,e=r.z,o=r.alpha,i=(a=t/1)<=Kr?_r*a:116*Math.cbrt(a)-16,u=va(n,t,e),h=ba(n,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-ga),h=13*i*(h-Ma)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l},ya=function(r){return ma(J(r))},xa=4*(jr=Gr)/(jr+15*1+3*Wr),wa=function(r,a,n){return 9*a/(r+15*a+3*n)}(Gr,1,Wr),za=function(r){var a=r.l,n=r.u,t=r.v,e=r.alpha,o=n/(13*a)+xa,i=t/(13*a)+wa,u=1*(a<=8?a/_r: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},ka=function(r){return K(za(r))},Pa={mode:"luv",output:{xyz:za,rgb:ka},input:{xyz:ma,rgb:ya},channels:["l","u","v","alpha"],parsers:["--luv"],serialize:"color(--luv ",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:k,u:k,v:k,alpha:{use:k,fixup:P}}},qa=function(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=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},Ia=function(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},ja={mode:"lchuv",output:{luv:Ia,rgb:function(r){return ka(Ia(r))}},input:{rgb:function(r){return qa(ya(r))},luv:qa},channels:["l","c","h","alpha"],parsers:["--lchuv"],serialize:"color(--lchuv ",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:k,fixup:or},c:k,l:k,alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Ea=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Sa=Math.PI/180,Oa=180/Math.PI,Ca=Ea[3]*Ea[4],Ra=Ea[1]*Ea[4],Aa=Ea[1]*Ea[2]-Ea[0]*Ea[3],Ha={mode:"cubehelix",channels:["h","s","l","alpha"],parsers:["--cubehelix"],serialize:"color(--cubehelix ",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=(Aa*t+a*Ca-n*Ra)/(Aa+Ca-Ra),i=t-o,u=(Ea[4]*(n-o)-Ea[2]*i)/Ea[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(Ea[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*Oa-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)*Sa;var i=void 0===n?0:n*t*(1-t),u=Math.cos(a),h=Math.sin(a);return o.r=t+i*(Ea[0]*u+Ea[1]*h),o.g=t+i*(Ea[2]*u+Ea[3]*h),o.b=t+i*(Ea[4]*u+Ea[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:k,fixup:or},s:k,l:k,alpha:{use:k,fixup:P}},difference:{h:br},average:{h:yr}},Na=function(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=nr(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i},$a=26/180*Math.PI,Da=Math.cos($a),La=Math.sin($a),Ta=100/Math.log(1.39),Ba=function(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"lab65",l:(Math.exp(1*a/Ta)-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-$a),h=i*Math.sin(t/180*Math.PI-$a);o.a=u*Da-h/.83*La,o.b=u*La+h/.83*Da}return void 0!==e&&(o.alpha=e),o},Fa=function(r){return Ba(Na(r))},Ga=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=n*Da+t*La,i=.83*(t*Da-n*La),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:Ta/1*Math.log(1+.0039*a),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=nr((Math.atan2(i,o)+$a)/Math.PI*180)),void 0!==e&&(h.alpha=e),h},Wa=function(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},_a=function(r){return Wa(Ga(r))},Ka={mode:"dlab",parsers:["--din99o-lab"],serialize:"color(--din99o-lab ",output:{lab65:Fa,rgb:function(r){return ia(Fa(r))}},input:{lab65:_a,rgb:function(r){return _a(la(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:P}}},Ja={mode:"dlch",parsers:["--din99o-lch"],serialize:"color(--din99o-lch ",output:{lab65:Ba,dlab:Wa,rgb:function(r){return ia(Ba(r))}},input:{lab65:Ga,dlab:Na,rgb:function(r){return Ga(la(r))}},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:k,c:k,h:{use:k,fixup:or},alpha:{use:k,fixup:P}},difference:{h:Mr},average:{h:yr}},Qa={mode:"xyz",parsers:["xyz","--xyz-d50"],serialize:"color(--xyz-d50 ",output:{rgb:K,lab:Xr},input:{rgb:J,lab:Qr},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:P}}},Ua={mode:"xyz65",serialize:"color(--xyz-d65 ",output:{rgb:$,xyz:function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"xyz",x:1.0478112*a+.0228866*n-.050127*t,y:.0295424*a+.9904844*n-.0170491*t,z:-.0092345*a+.0150436*n+.7521316*t};return void 0!==e&&(o.alpha=e),o}},input:{rgb:N,xyz:function(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"xyz65",x:.9555766*a-.0230393*n+.0631636*t,y:-.0282895*a+1.0099416*n+.0210077*t,z:.0122982*a-.020483*n+1.3299098*t};return void 0!==e&&(o.alpha=e),o}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parsers:["--xyz-d65"],interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:P}}},Va={mode:"yiq",output:{rgb:function(r){var a=r.y,n=r.i,t=r.q,e=r.alpha;return S({r:a+.95608445*n+.6208885*t,g:a-.27137664*n-.6486059*t,b:a-1.10561724*n+1.70250126*t,alpha:e})}},input:{rgb:function(r){var a=j(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"],parsers:["--yiq"],serialize:"color(--yiq ",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:k,i:k,q:k,alpha:{use:k,fixup:P}}},Xa=function(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=Math.pow(a+.3963377774*n+.2158037573*t,3),i=Math.pow(a-.1055613458*n-.0638541728*t,3),u=Math.pow(a-.0894841775*n-1.291485548*t,3),h={mode:"lrgb",r:4.0767416621*o-3.3077115913*i+.2309699292*u,g:-1.2684380046*o+2.6097574011*i-.3413193965*u,b:-.0041960863*o-.7034186147*i+1.707614701*u};return void 0!==e&&(h.alpha=e),h},Ya=function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.cbrt(.4122214708*a+.5363325363*n+.0514459929*t),i=Math.cbrt(.2119034982*a+.6806995451*n+.1073969566*t),u=Math.cbrt(.0883024619*a+.2817188376*n+.6299787005*t),h={mode:"oklab",l:.2104542553*o+.793617785*i-.0040720468*u,a:1.9779984951*o-2.428592205*i+.4505937099*u,b:.0259040371*o+.7827717662*i-.808675766*u};return void 0!==e&&(h.alpha=e),h},Za=function(r){var a=Ya(j(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a},rn=function(r){return S(Xa(r))},an=Object.assign({},Zr,{mode:"oklab",output:{lrgb:Xa,rgb:rn},input:{lrgb:Ya,rgb:Za},ranges:{l:[0,.999],a:[-.233,.276],b:[-.311,.198]},parsers:["--oklab"],serialize:"color(--oklab "}),nn=Object.assign({},fa,{mode:"oklch",output:{oklab:function(r){return pa(r,"oklab")},rgb:function(r){return rn(pa(r,"oklab"))}},input:{rgb:function(r){return sa(Za(r),"oklch")},oklab:function(r){return sa(r,"oklch")}},parsers:["--oklch"],serialize:"color(--oklch ",ranges:{l:[0,.999],c:[0,.322],h:[0,360]}}),tn=function(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}},en=vr("rgb"),on=vr("hsl"),un=tn(2),hn=function(r){return Math.max(0,Math.min(1,r))},ln=function(r){return Math.round(255*hn(r))},cn=function(r){var a=en(r);if(void 0!==a)return"#"+(1<<24|ln(a.r)<<16|ln(a.g)<<8|ln(a.b)).toString(16).slice(1)},sn=function(r){var a=en(r);if(void 0!==a){var n=ln(a.r),t=ln(a.g),e=ln(a.b);return void 0===a.alpha||1===a.alpha?"rgb("+n+", "+t+", "+e+")":"rgba("+n+", "+t+", "+e+", "+un(hn(a.alpha))+")"}},pn=function(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))}},fn=function(r,a,n){void 0===a&&(a="rgb"),void 0===n&&(n=!1);var t=a?pr(a).channels:null,e=a?vr(a):dr;return function(o){var i=e(o),u=(t||pr(o.mode).channels).reduce((function(n,t){var e=r(i[t],t,i,a);return void 0===e||isNaN(e)||(n[t]=e),n}),{mode:a});if(!n)return u;var h=dr(o);return h&&h.mode!==u.mode?vr(h.mode)(u):u}},dn=function(r,a,n){return"alpha"!==a?(r||0)*(void 0!==n.alpha?n.alpha:1):r},vn=function(r,a,n){return"alpha"!==a&&0!==n.alpha?(r||0)/(void 0!==n.alpha?n.alpha:1):r},bn=function(r,a){return void 0===r&&(r=1),void 0===a&&(a=0),function(n,t){return"alpha"!==t?n*r+a:n}},gn=function(r){return"function"==typeof r},Mn=function(r){return r&&"object"==typeof r},mn=function(r){return"number"==typeof r},yn=function(r,a,n,t){void 0===a&&(a="rgb");var e=pr(a),o=vr(a),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):mn(r)||gn(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=Mn(n)&&Mn(n[a])&&n[a].fixup?n[a].fixup:Mn(e.interpolate[a])&&e.interpolate[a].fixup?e.interpolate[a].fixup:function(r){return r},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 s=e.channels.reduce((function(r,a){var t;return gn(n)?t=n:Mn(n)&&gn(n[a])?t=n[a]:Mn(n)&&Mn(n[a])&&n[a].use?t=n[a].use:gn(e.interpolate[a])?t=e.interpolate[a]:Mn(e.interpolate[a])&&(t=e.interpolate[a].use),r[a]=t(l[a]),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 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&&(mn(c)&&(c=pn((c-t)/o)),l=c(l));var f=(n-1+l)/p;return e.channels.reduce((function(r,a){var n=s[a](f);return void 0!==n&&(r[a]=n),r}),{mode:a})}},xn=function(r,a){return function(n,t,e){void 0===t&&(t="rgb");var o=a?fn(a,t):void 0,i=yn(n,t,e,r);return o?function(r){return o(i(r))}:i}},wn=xn(dn,vn),zn=function(r){return(1-Math.cos(r*Math.PI))/2},kn=function(r,a){return(r+a)%a},Pn=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},qn=function(r){return function(a){var n=r.length-1,t=a>=1?n-1:Math.max(0,Math.floor(a*n));return Pn(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)}},In=function(r){return function(a){var n=r.length-1,t=Math.floor(a*n);return Pn(r[kn(t-1,r.length)],r[kn(t,r.length)],r[kn(t+1,r.length)],r[kn(t+2,r.length)],(a-t/n)*n)}},jn=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},En=function(r){return qn(jn(r))},Sn=function(r){return In(jn(r))},On=Math.sign,Cn=Math.min,Rn=Math.abs,An=function(r){for(var a=r.length-1,n=[],t=[],e=[],o=0;o<a;o++)n.push((r[o+1]-r[o])*a),t.push(o>0?.5*(r[o+1]-r[o-1])*a:void 0),e.push(o>0?(On(n[o-1])+On(n[o]))*Cn(Rn(n[o-1]),Rn(n[o]),.5*Rn(t[o])):void 0);return[n,t,e]},Hn=function(r,a,n){var t=r.length-1,e=t*t;return function(o){var i,u=o-(i=o>=1?t-1:Math.max(0,Math.floor(o*t)))/t,h=u*u,l=h*u;return(a[i]+a[i+1]-2*n[i])*e*l+(3*n[i]-2*a[i]-a[i+1])*t*h+a[i]*u+r[i]}},Nn=function(r){if(r.length<3)return k(r);var a=r.length-1,n=An(r),t=n[0],e=n[2];return e[0]=t[0],e[a]=t[a-1],Hn(r,e,t)},$n=function(r){var a=r.length-1,n=An(r),t=n[0],e=n[1],o=n[2];e[0]=.5*(r[1]-r[a])*a,e[a]=.5*(r[0]-r[a-1])*a;var i=(r[0]-r[a])*a,u=i;return o[0]=(On(i)+On(t[0]))*Cn(Rn(i),Rn(t[0]),.5*Rn(e[0])),o[a]=(On(t[a-1])+On(u))*Cn(Rn(t[a-1]),Rn(u),.5*Rn(e[a])),Hn(r,o,t)},Dn=vr("rgb"),Ln=function(r){var a=Dn(r);return void 0!==a&&a.r>=0&&a.r<=1&&a.g>=0&&a.g<=1&&a.b>=0&&a.b<=1},Tn=vr("rgb"),Bn=function(r){var a=Tn(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},Fn=function(r){return void 0===(r=dr(r))||Ln(r)?r:vr(r.mode)(Bn(r))},Gn=function(r,a){if(void 0===a&&(a="lch"),void 0===(r=dr(r))||Ln(r))return r;var n=vr(r.mode);r=vr(a)(r);var t=Object.assign({},r,{c:0});if(!Ln(t))return n(Bn(t));for(var e,o=0,i=r.c,u=pr(a).ranges.c,h=(u[1]-u[0])/Math.pow(2,13);i-o>h;)t.c=o+.5*(i-o),Ln(t)?(e=t.c,o=t.c):i=t.c;return n(Ln(t)?t:Object.assign({},t,{c:e}))},Wn={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 _n(r){var a=vr("lrgb")(r);return.2126*a.r+.7152*a.g+.0722*a.b}var Kn=vr("rgb"),Jn=[[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]],Qn=[[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]],Un=[[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]],Vn=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 x(o[a],i[a],e)}))}return function(r){var a=dr(r);if(void 0!==a){var n=Kn(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),vr(a.mode)(u)}}},Xn=function(r){return void 0===r&&(r=1),Vn(Jn,r)},Yn=function(r){return void 0===r&&(r=1),Vn(Qn,r)},Zn=function(r){return void 0===r&&(r=1),Vn(Un,r)},rt=function(r){return Math.max(r,0)},at=function(r){return Math.max(Math.min(r,1),0)},nt=function(r,a,n){void 0===n&&(n=!1);var t=vr(a),e=pr(a).channels;return function(o){var i=t(o);if(i){for(var u,h={mode:a},l=e.length,c=0;c<r.length;c++)void 0!==i[u=e[Math.floor(c/l)]]&&(h[u]=(h[u]||0)+r[c]*(i[e[c%l]]||0));if(!n)return h;var s=dr(o);return s&&h.mode!==s.mode?vr(s.mode)(h):h}}};sr(D),sr(Ha),sr(Ka),sr(Ja),sr(Ir),sr(zr),sr(qr),sr(Er),sr(Lr),sr(Fr),sr(Zr),sr(ca),sr(fa),sr(da),sr(ja),sr(O),sr(Pa),sr(B),sr(Q),sr(ar),sr(q),sr(Ua),sr(Qa),sr(Va),sr(an),sr(nn);var tt=vr("a98"),et=vr("cubehelix"),ot=vr("dlab"),it=vr("dlch"),ut=vr("hsi"),ht=vr("hsl"),lt=vr("hsv"),ct=vr("hwb"),st=vr("jab"),pt=vr("jch"),ft=vr("lab"),dt=vr("lab65"),vt=vr("lch"),bt=vr("lch65"),gt=vr("lchuv"),Mt=vr("lrgb"),mt=vr("luv"),yt=vr("p3"),xt=vr("prophoto"),wt=vr("rec2020"),zt=vr("rgb"),kt=vr("xyz"),Pt=vr("xyz65"),qt=vr("yiq"),It=vr("oklab"),jt=vr("oklch");r.a98=tt,r.average=function(r,a,n){void 0===a&&(a="rgb");var t=pr(a),e=r.map(vr(a));return t.channels.reduce((function(r,a){var o,i=e.map((function(r){return r[a]})).filter((function(r){return void 0!==r}));i.length&&(o=wr(n)?n:n&&wr(n[a])?n[a]:t.average&&wr(t.average[a])?t.average[a]:xr,r[a]=o(i,a));return r}),{mode:a})},r.averageAngle=yr,r.averageNumber=xr,r.blend=function(r,a,n){void 0===a&&(a="normal"),void 0===n&&(n="rgb");var t="function"==typeof a?a:Wn[a],e=vr(n),o=pr(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 Fn;case"lch":return Gn}},r.clampChroma=Gn,r.clampRgb=Fn,r.colorsNamed=n,r.converter=vr,r.cubehelix=et,r.deficiencyDeuter=Yn,r.deficiencyProt=Xn,r.deficiencyTrit=Zn,r.defineMode=sr,r.differenceCie76=function(){return mr("lab65")},r.differenceCie94=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=.045),void 0===n&&(n=.015);var t=vr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),p=u.l,f=u.a,d=u.b,v=Math.sqrt(f*f+d*d),b=Math.pow(h-p,2),g=Math.pow(s-v,2),M=Math.pow(l-f,2)+Math.pow(c-d,2)-g;return Math.sqrt(b/Math.pow(r,2)+g/Math.pow(1+a*s,2)+M/Math.pow(1+n*s,2))}},r.differenceCiede2000=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=1);var t=vr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,s=Math.sqrt(l*l+c*c),p=u.l,f=u.a,d=u.b,v=(s+Math.sqrt(f*f+d*d))/2,b=.5*(1-Math.sqrt(Math.pow(v,7)/(Math.pow(v,7)+Math.pow(25,7)))),g=l*(1+b),M=f*(1+b),m=Math.sqrt(g*g+c*c),y=Math.sqrt(M*M+d*d),x=Math.abs(g)+Math.abs(c)===0?0:Math.atan2(c,g);x+=2*(x<0)*Math.PI;var w=Math.abs(M)+Math.abs(d)===0?0:Math.atan2(d,M);w+=2*(w<0)*Math.PI;var z=p-h,k=y-m,P=m*y==0?0:w-x;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var q,I=2*Math.sqrt(m*y)*Math.sin(P/2),j=(h+p)/2,E=(m+y)/2;m*y==0?q=x+w:(q=(x+w)/2,q-=(Math.abs(x-w)>Math.PI)*Math.PI,q+=2*(q<0)*Math.PI);var S=Math.pow(j-50,2),O=1-.17*Math.cos(q-Math.PI/6)+.24*Math.cos(2*q)+.32*Math.cos(3*q+Math.PI/30)-.2*Math.cos(4*q-63*Math.PI/180),C=1+.015*S/Math.sqrt(20+S),R=1+.045*E,A=1+.015*E*O,H=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*q-275)/25,2)),N=2*Math.sqrt(Math.pow(E,7)/(Math.pow(E,7)+Math.pow(25,7))),$=-1*Math.sin(2*H)*N;return Math.sqrt(Math.pow(z/(r*C),2)+Math.pow(k/(a*R),2)+Math.pow(I/(n*A),2)+$*k/(a*R)*I/(n*A))}},r.differenceCmc=function(r,a){void 0===r&&(r=1),void 0===a&&(a=1);var n=vr("lab65");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 s=n(e),p=s.l,f=s.a,d=s.b,v=Math.sqrt(f*f+d*d),b=Math.pow(i-p,2),g=Math.pow(l-v,2),M=Math.pow(u-f,2)+Math.pow(h-d,2)-g,m=Math.sqrt(Math.pow(l,4)/(Math.pow(l,4)+1900)),y=i<16?.511:.040975*i/(1+.01765*i),x=.0638*l/(1+.0131*l)+.638,w=x*(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(r*y,2)+g/Math.pow(a*x,2)+M/Math.pow(w,2))}},r.differenceDin99o=function(){return mr("dlab")},r.differenceEuclidean=mr,r.differenceHueChroma=Mr,r.differenceHueNaive=gr,r.differenceHueSaturation=br,r.differenceHyab=function(){var r=vr("lab65");return function(a,n){var t=r(a),e=r(n),o=t.l-e.l,i=t.a-e.a,u=t.b-e.b;return Math.abs(o)+Math.sqrt(i*i+u*u)}},r.differenceKotsarenkoRamos=function(){return mr("yiq",[.5053,.299,.1957])},r.displayable=Ln,r.dlab=ot,r.dlch=it,r.easingGamma=w,r.easingInOutSine=zn,r.easingMidpoint=pn,r.easingSmootherstep=function(r){return r*r*r*(r*(6*r-15)+10)},r.easingSmoothstep=function(r){return r*r*(3-2*r)},r.filterBrightness=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=rt(r);return fn(bn(n),a,!0)},r.filterContrast=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=rt(r);return fn(bn(n,(1-n)/2),a,!0)},r.filterDeficiencyDeuter=Yn,r.filterDeficiencyProt=Xn,r.filterDeficiencyTrit=Zn,r.filterGrayscale=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),nt([.2126+.7874*(n=1-at(r)),.7152-.7152*n,.0722-.0722*n,0,.2126-.2126*n,.7152+.2848*n,.0722-.0722*n,0,.2126-.2126*n,.7152-.7152*n,.0722+.9278*n,0,0,0,0,1],a,!0);var n},r.filterHueRotate=function(r,a){return void 0===r&&(r=0),void 0===a&&(a="rgb"),nt(function(r){var a=Math.PI*r/180,n=Math.cos(a),t=Math.sin(a);return[.213+.787*n-.213*t,.715-.715*n-.715*t,.072-.072*n+.928*t,0,.213-.213*n+.143*t,.715+.285*n+.14*t,.072-.072*n-.283*t,0,.213-.213*n-.787*t,.715-.715*n+.715*t,.072+.928*n+.072*t,0,0,0,0,1]}(r),a,!0)},r.filterInvert=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=at(r);return fn((function(r,a){return"alpha"===a?r:function(r,a,n){return void 0===r||void 0===a?void 0:r+n*(a-r)}(n,1-n,r)}),a,!0)},r.filterSaturate=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),nt(function(r){var a=rt(r);return[.213+.787*a,.715-.715*a,.072-.072*a,0,.213-.213*a,.715+.285*a,.072-.072*a,0,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,0,1]}(r),a,!0)},r.filterSepia=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),nt([.393+.607*(n=1-at(r)),.769-.769*n,.189-.189*n,0,.349-.349*n,.686+.314*n,.168-.168*n,0,.272-.272*n,.534-.534*n,.131+.869*n,0,0,0,0,1],a,!0);var n},r.fixupAlpha=P,r.fixupHueDecreasing=function(r){return er(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return er(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return er(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=or,r.formatCss=function(r){var a=dr(r);if(a){var n=pr(a.mode);if(!n.serialize||"string"==typeof n.serialize){var t=n.serialize||"color(--"+a.mode+" ";return n.channels.forEach((function(r,n){"alpha"!==r&&(t+=(n?" ":"")+(a[r]||0))})),void 0!==a.alpha&&a.alpha<1&&(t+=" / "+a.alpha),t+")"}return"function"==typeof n.serialize?n.serialize(a):void 0}},r.formatHex=cn,r.formatHex8=function(r){var a=en(r);if(void 0!==a){var n=ln(void 0!==a.alpha?a.alpha:1);return cn(a)+(256|n).toString(16).slice(1)}},r.formatHsl=function(r){var a=on(r);if(void 0!==a){var n=un(a.h||0),t=un(100*hn(a.s)),e=un(100*hn(a.l));return void 0===a.alpha||1===a.alpha?"hsl("+n+", "+t+"%, "+e+"%)":"hsla("+n+", "+t+"%, "+e+"%, "+un(hn(a.alpha))+")"}},r.formatRgb=sn,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return sn;case"hex":return cn}},r.getModeDefinition=pr,r.hsi=ut,r.hsl=ht,r.hsv=lt,r.hwb=ct,r.interpolate=function(r,a,n){return void 0===a&&(a="rgb"),yn(r,a,n)},r.interpolateAlpha=P,r.interpolateCosine=function(r,a){return void 0===a&&(a=1),function(n){var t=w(a),e=z((function(r,a,n){return x(r,a,zn(n))}))((r||function(r){return r})(n));return function(r){return e(t(r))}}},r.interpolateHue=or,r.interpolateLinear=function(r,a){return void 0===a&&(a=1),function(n){var t=w(a);return function(a){return k((r||function(r){return r})(n))(t(a))}}},r.interpolateSplineBasis=function(r,a,n){return void 0===a&&(a="default"),void 0===n&&(n=1),function(t){var e=w(n);return"default"===a?function(a){return qn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return In((r||function(r){return r})(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=w(n);return"closed"===a?function(a){return $n((r||function(r){return r})(t))(e(a))}:"default"===a?function(a){return Nn((r||function(r){return r})(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=w(n);return"default"===a?function(a){return En((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return Sn((r||function(r){return r})(t))(e(a))}:void 0}},r.interpolateWith=xn,r.interpolateWithPremultipliedAlpha=wn,r.interpolatorLinear=k,r.interpolatorPiecewise=z,r.interpolatorSplineBasis=qn,r.interpolatorSplineBasisClosed=In,r.interpolatorSplineMonotone=Nn,r.interpolatorSplineMonotone2=function(r){if(r.length<3)return k(r);var a=r.length-1,n=An(r),t=n[0],e=n[1],o=n[2];return e[0]=(2*r[1]-1.5*r[0]-.5*r[2])*a,e[a]=(1.5*r[a]-2*r[a-1]+.5*r[a-2])*a,o[0]=e[0]*t[0]<=0?0:Rn(e[0])>2*Rn(t[0])?2*t[0]:e[0],o[a]=e[a]*t[a-1]<=0?0:Rn(e[a])>2*Rn(t[a-1])?2*t[a-1]:e[a],Hn(r,o,t)},r.interpolatorSplineMonotoneClosed=$n,r.interpolatorSplineNatural=En,r.interpolatorSplineNaturalClosed=Sn,r.jab=st,r.jch=pt,r.lab=ft,r.lab65=dt,r.lch=vt,r.lch65=bt,r.lchuv=gt,r.lerp=x,r.lrgb=Mt,r.luv=mt,r.mapAlphaDivide=vn,r.mapAlphaMultiply=dn,r.mapTransferGamma=function(r,a,n){return void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=0),function(t,e){return"alpha"!==e?r*Math.pow(t,a)+n:t}},r.mapTransferLinear=bn,r.mapper=fn,r.nearest=function(r,a,n){void 0===a&&(a=mr()),void 0===n&&(n=function(r){return r});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.oklab=It,r.oklch=jt,r.p3=yt,r.parse=fr,r.prophoto=xt,r.random=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a={});var n=pr(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.rec2020=wt,r.rgb=zt,r.round=tn,r.samples=function(r,a){void 0===r&&(r=2),void 0===a&&(a=1);var n=w(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=_n(r),t=_n(a);return(Math.max(n,t)+.05)/(Math.min(n,t)+.05)},r.wcagLuminance=_n,r.xyz=kt,r.xyz65=Pt,r.yiq=qt,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "culori",
"version": "0.20.0",
"version": "0.20.1",
"main": "build/culori.umd.js",

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

"@11ty/eleventy": "^0.12.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2",
"@rollup/plugin-buble": "^0.21.3",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.23.4",

@@ -46,10 +46,11 @@ "esm": "^3.2.25",

"nyc": "^15.1.0",
"prettier": "^2.3.1",
"prettier": "^2.3.2",
"pretty-quick": "^3.1.1",
"rollup": "^2.52.2",
"rollup": "^2.56.1",
"rollup-plugin-terser": "^7.0.2",
"tap-spec": "^5.0.0",
"tape": "^5.2.2"
"tape": "^5.3.1"
},
"scripts": {
"start": "rollup -cw",
"build": "rollup -c",

@@ -56,0 +57,0 @@ "test": "tape -r esm 'test/*.js' | tap-spec",

![culori](./docs/img/culori.svg)
<a href="https://www.npmjs.org/package/culori"><img src="https://img.shields.io/npm/v/culori.svg?style=flat-square&labelColor=d84f4c&color=black" alt="npm version"></a> <a href="https://bundlephobia.com/result?p=culori"><img src="https://img.shields.io/bundlephobia/minzip/culori?style=flat-square&labelColor=d84f4c&color=black" alt="npm version"></a>
<a href="https://www.npmjs.org/package/culori"><img src="https://img.shields.io/npm/v/culori.svg?style=flat-square&labelColor=d84f4c&color=black" alt="npm version"></a> <a href="https://bundlephobia.com/result?p=culori"><img src="https://img.shields.io/bundlephobia/minzip/culori?style=flat-square&labelColor=d84f4c&color=black" alt="bundle size"></a>

@@ -5,0 +5,0 @@ Culori is a color library for JavaScript that works across many color spaces to offer conversion, interpolation, color difference formulas, blending functions, and more.

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc