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.18.1 to 0.18.2

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";function a(r,a){if("number"==typeof r)return 3===a?{mode:"rgb",r:(r>>8&15|r>>4&240)/255,g:(r>>4&15|240&r)/255,b:(15&r|r<<4&240)/255}:4===a?{mode:"rgb",r:(r>>12&15|r>>8&240)/255,g:(r>>8&15|r>>4&240)/255,b:(r>>4&15|240&r)/255,alpha:(15&r|r<<4&240)/255}:6===a?{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}:8===a?{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(255&r)/255}:void 0}var n={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o=t+"%?",i="(?:"+t+"%|"+t+")",u="(?:"+t+"(deg|grad|rad|turn)|"+t+")",h="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+h+t+h+t+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),d=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),s=new RegExp("^hsla?\\(\\s*"+u+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+o+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+o+l+t+l+u+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$");function y(r,a,n){return r+n*(a-r)}function x(r){return void 0===r&&(r=1),1===r?function(r){return r}:function(a){return Math.pow(a,r)}}var w=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=w(y),z=function(r){var a=!1,n=r.map((function(r){return void 0!==r?(a=!0,r):1}));return a?n:r},P={mode:"rgb",channels:["r","g","b","alpha"],alias:["srgb"],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(f)||r.match(d)))return;n={mode:"rgb",r:a[1]/100,g:a[2]/100,b:a[3]/100}}return void 0!==a[4]?n.alpha=a[4]/100:void 0!==a[5]&&(n.alpha=+a[5]),n},function(r){return"string"==typeof r&&a(n[r.toLowerCase()],6)||void 0},function(r){return"transparent"===r?a(0,8):void 0}],interpolate:{r:k,g:k,b:k,alpha:{use:k,fixup:z}}},I=function(r){return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)};function q(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}var j=function(r){return r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r};function S(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:j(n),g:j(t),b:j(e)};return void 0!==o&&(i.alpha=o),i}var E=Object.assign({},P,{mode:"lrgb",output:{rgb:S},input:{rgb:q},parsers:[]}),O=function(r){return Math.pow(Math.abs(r),563/256)*Math.sign(r)};function A(r){var a=O(r.r),n=O(r.g),t=O(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}var C=function(r){return Math.pow(Math.abs(r),256/563)*Math.sign(r)};function R(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"a98",r:C(2.0415879038107465*a-.5650069742788596*n-.34473135077832956*t),g:C(-.9692436362808795*a+1.8759675015077202*n+.04155505740717557*t),b:C(.013444280632031142*a-.11836239223101838*n+1.0151749943912054*t)};return void 0!==e&&(o.alpha=e),o}function N(r){var a=q(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 H(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}var $=Object.assign({},P,{mode:"a98",alias:["a98-rgb"],parsers:[],input:{rgb:function(r){return R(N(r))},xyz65:R},output:{rgb:function(r){return H(A(r))},xyz65:A}});function D(r){var a=q(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}function L(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}var T=Object.assign({},P,{mode:"p3",alias:["display-p3"],input:{rgb:function(r){return L(N(r))},xyz65:L},output:{rgb:function(r){return H(D(r))},xyz65:D},parsers:[]}),B=function(r){return r>=1/512?Math.pow(r,1/1.8):16*r};function F(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"prophoto",r:B(1.3457989731028281*a-.25558010007997534*n-.05110628506753401*t),g:B(-.5446224939028347*a+1.5082327413132781*n+.02053603239147973*t),b:B(0*a+0*n+1.2119675456389454*t)};return void 0!==e&&(o.alpha=e),o}var G=function(r){return r>=16/512?Math.pow(r,1.8):r/16};function W(r){var a=G(r.r),n=G(r.g),t=G(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}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}function K(r){var a=q(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"xyz",x:.4360747*n+.3850649*t+.1430804*e,y:.2225045*n+.7168786*t+.0606169*e,z:.0139322*n+.0971045*t+.7141733*e};return void 0!==o&&(i.alpha=o),i}var J=Object.assign({},P,{mode:"prophoto",alias:["prophoto-rgb"],parsers:[],input:{xyz:F,rgb:function(r){return F(K(r))}},output:{xyz:W,rgb:function(r){return _(W(r))}}}),Q=1.09929682680944,U=function(r){return r>.018053968510807?Q*Math.pow(r,1/2.4)-(Q-1):4.5*r};function V(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o={mode:"rec2020",r:U(1.7166511879712674*a-.35567078377639233*n-.25336628137365974*t),g:U(-.6666843518324892*a+1.6164812366349395*n+.01576854581391113*t),b:U(.017639857445310783*a-.042770613257808524*n+.9421031212354738*t)};return void 0!==e&&(o.alpha=e),o}var X=1.09929682680944,Y=function(r){return r<.08124285829863151?r/4.5:Math.pow((r+X-1)/X,2.4)};function Z(r){var a=Y(r.r),n=Y(r.g),t=Y(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}var rr=Object.assign({},P,{mode:"rec2020",input:{xyz:V,rgb:function(r){return V(N(r))}},output:{xyz:Z,rgb:function(r){return H(Z(r))}},parsers:[]});function ar(r){return(r%=360)<0?r+360:r}var nr=function(r,a){switch(a){case"deg":return+r;case"rad":return r/Math.PI*180;case"grad":return r/10*9;case"turn":return 360*r}};var tr=function(r,a){return r.map((function(n,t,e){if(void 0===n)return n;var o=ar(n);return 0===t||void 0===r[t-1]?o:a(o-ar(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)}),[])},er=function(r){return tr(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},or={},ir={},ur=[],hr=function(r){return r},lr=function(r){or[r.mode]=Object.assign(or[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(a){or[a]||(or[a]={}),or[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=hr)})),ir[r.mode]=r,(r.parsers||[]).forEach((function(r){return ur.push(r)}))},cr=function(r){return ir[r]},fr=function(r){for(var a,n=0,t=ur.length;n<t&&void 0===(a=ur[n++](r)););return a};function pr(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}var dr=function(r){return void 0===r&&(r="rgb"),function(a){return void 0!==(a=pr(a,r))?a.mode===r?a:or[a.mode][r]?or[a.mode][r](a):"rgb"===r?or[a.mode].rgb(a):or.rgb[r](or[a.mode].rgb(a)):void 0}},sr=function(r,a){if(void 0===r.h||void 0===a.h||!r.s||!a.s)return 0;var n=ar(r.h),t=ar(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*a.s)*e},vr=function(r,a){if(void 0===r.h||void 0===a.h)return 0;var n=ar(r.h),t=ar(a.h);return Math.abs(t-n)>180?n-(t-360*Math.sign(t-n)):t-n},br=function(r,a){if(void 0===r.h||void 0===a.h||!r.c||!a.c)return 0;var n=ar(r.h),t=ar(a.h),e=Math.sin((t-n+360)/2*Math.PI/180);return 2*Math.sqrt(r.c*a.c)*e},gr=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a=[1,1,1,0]);var n=cr(r),t=n.channels,e=n.difference,o=dr(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))}},Mr=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},mr=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},yr=function(r){return"function"==typeof r};var xr={mode:"hsl",output:{rgb:function(r){var a=r.h,n=r.s,t=r.l,e=r.alpha;a=ar(a);var o,i=t+n*(t<.5?t:1-t),u=i-2*(i-t)*Math.abs(a/60%2-1);switch(Math.floor(a/60)){case 0:o={r:i,g:u,b:2*t-i};break;case 1:o={r:u,g:i,b:2*t-i};break;case 2:o={r:2*t-i,g:i,b:u};break;case 3:o={r:2*t-i,g:u,b:i};break;case 4:o={r:u,g:2*t-i,b:i};break;case 5:o={r:i,g:2*t-i,b:u};break;default:o={r:2*t-i,g:2*t-i,b:2*t-i}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.max(a,n,t),i=Math.min(a,n,t),u={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(u.h=60*(o===a?(n-t)/(o-i)+6*(n<t):o===n?(t-a)/(o-i)+2:(a-n)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var a=r.match(s)||r.match(v);if(a){var n={mode:"hsl",h:void 0===a[3]?nr(a[1],a[2]):+a[3],s:Math.min(Math.max(0,a[4]/100),1),l:Math.min(Math.max(0,a[5]/100),1)};return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=a[7]/255),n}}}],interpolate:{h:{use:k,fixup:er},s:k,l:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};function wr(r){var a=r.h,n=r.s,t=r.v,e=r.alpha;a=ar(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 kr(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 zr={mode:"hsv",output:{rgb:wr},input:{rgb:kr},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:er},s:k,v:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};var Pr={mode:"hsi",output:{rgb:function(r){var a=r.h,n=r.s,t=r.i,e=r.alpha;a=ar(a);var o,i=Math.abs(a/60%2-1);switch(Math.floor(a/60)){case 0:o={r:t*(1+n*(3/(2-i)-1)),g:t*(1+n*(3*(1-i)/(2-i)-1)),b:t*(1-n)};break;case 1:o={r:t*(1+n*(3*(1-i)/(2-i)-1)),g:t*(1+n*(3/(2-i)-1)),b:t*(1-n)};break;case 2:o={r:t*(1-n),g:t*(1+n*(3/(2-i)-1)),b:t*(1+n*(3*(1-i)/(2-i)-1))};break;case 3:o={r:t*(1-n),g:t*(1+n*(3*(1-i)/(2-i)-1)),b:t*(1+n*(3/(2-i)-1))};break;case 4:o={r:t*(1+n*(3*(1-i)/(2-i)-1)),g:t*(1-n),b:t*(1+n*(3/(2-i)-1))};break;case 5:o={r:t*(1+n*(3/(2-i)-1)),g:t*(1-n),b:t*(1+n*(3*(1-i)/(2-i)-1))};break;default:o={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.max(a,n,t),i=Math.min(a,n,t),u={mode:"hsi",s:a+n+t===0?0:1-3*i/(a+n+t),i:(a+n+t)/3};return o-i!=0&&(u.h=60*(o===a?(n-t)/(o-i)+6*(n<t):o===n?(t-a)/(o-i)+2:(a-n)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:er},s:k,i:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};var Ir={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 wr({h:a,s:1===t?1:1-n/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var a=kr(r);if(void 0!==a){var n={mode:"hwb",w:(1-a.s)*a.v,b:1-a.v};return void 0!==a.h&&(n.h=a.h),void 0!==a.alpha&&(n.alpha=a.alpha),n}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var a=r.match(g);if(a){var n={mode:"hwb",h:void 0===a[3]?nr(a[1],a[2]):+a[3],w:a[4]/100,b:a[5]/100};if(n.w+n.b>1){var t=n.w+n.b;n.w/=t,n.b/=t}return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=a[7]/255),n}}}],interpolate:{h:{use:k,fixup:er},w:k,b:k,alpha:{use:k,fixup:z}},difference:{h:vr},average:{h:Mr}},qr=function(r){var a=Math.pow(r/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*a)/(1+18.6875*a),134.03437499999998)},jr=function(r){return Math.max(203*r,0)};function Sr(r){var a=r.x,n=r.y,t=r.z,e=r.alpha;a=jr(a),n=jr(n);var o=1.15*a-.15*(t=jr(t)),i=.66*n+.34*a,u=qr(.41478972*o+.579999*i+.014648*t),h=qr(-.20151*o+1.120649*i+.0531008*t),l=qr(-.0166008*o+.2648*i+.6684799*t),c=(u+h)/2,f={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&&(f.alpha=e),f}var Er=16295499532821565e-27,Or=function(r){var a=Math.pow(r,.007460772656268216);return 1e4*Math.pow((.8359375-a)/(18.6875*a-18.8515625),6.277394636015326)},Ar=function(r){return r/203};function Cr(r){var a=r.j,n=r.a,t=r.b,e=r.alpha,o=(a+Er)/(.44+.56*(a+Er)),i=Or(o+.13860504*n+.058047316*t),u=Or(o-.13860504*n-.058047316*t),h=Or(o-.096019242*n-.8118919*t),l={mode:"xyz65",x:Ar(1.661373024652174*i-.914523081304348*u+.23136208173913045*h),y:Ar(-.3250758611844533*i+1.571847026732543*u-.21825383453227928*h),z:Ar(-.090982811*i-.31272829*u+1.5227666*h)};return void 0!==e&&(l.alpha=e),l}function Rr(r){var a=Sr(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a}function Nr(r){return H(Cr(r))}var Hr={mode:"jab",channels:["j","a","b","alpha"],input:{rgb:Rr,xyz65:Sr},output:{rgb:Nr,xyz65:Cr},ranges:{j:[0,.221],a:[-.108,.129],b:[-.185,.134]},interpolate:{j:k,a:k,b:k,alpha:{use:k,fixup:z}}};function $r(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=ar(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}function Dr(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}var Lr={mode:"jch",output:{lab:Dr,rgb:function(r){return Nr(Dr(r))}},input:{rgb:function(r){return $r(Rr(r))},lab:$r},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:k,fixup:er},c:k,j:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},Tr=.96422,Br=.82521,Fr=Math.pow(29,3)/Math.pow(3,3),Gr=Math.pow(6,3)/Math.pow(29,3),Wr=function(r){return Math.pow(r,3)>Gr?Math.pow(r,3):(116*r-16)/Fr};function _r(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:Wr(n/500+o)*Tr,y:1*Wr(o),z:Wr(i)*Br};return void 0!==e&&(u.alpha=e),u}function Kr(r){return _(_r(r))}var Jr=function(r){return r>Gr?Math.cbrt(r):(Fr*r+16)/116};function Qr(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=Jr(a/Tr),i=Jr(n/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-Jr(t/Br))};return void 0!==e&&(u.alpha=e),u}function Ur(r){var a=Qr(K(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a}var Vr={mode:"lab",alias:["lab-d50"],output:{xyz:_r,rgb:Kr},input:{xyz:Qr,rgb:Ur},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.167,93.408],b:[-111.859,93.246]},parsers:[function(r){if("string"==typeof r){var a=r.match(M);if(a){var n={mode:"lab",l:+a[1],a:+a[2],b:+a[3]};return void 0!==a[4]?n.alpha=a[4]/100:void 0!==a[5]&&(n.alpha=+a[5]),n}}}],interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:z}}},Xr=Math.pow(29,3)/Math.pow(3,3),Yr=Math.pow(6,3)/Math.pow(29,3),Zr=function(r){return Math.pow(r,3)>Yr?Math.pow(r,3):(116*r-16)/Xr};function ra(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:.95047*Zr(n/500+o),y:1*Zr(o),z:1.08883*Zr(i)};return void 0!==e&&(u.alpha=e),u}function aa(r){return H(ra(r))}var na=function(r){return r>Yr?Math.cbrt(r):(Xr*r+16)/116};function ta(r){var a=r.x,n=r.y,t=r.z,e=r.alpha,o=na(a/.95047),i=na(n/1),u={mode:"lab65",l:116*i-16,a:500*(o-i),b:200*(i-na(t/1.08883))};return void 0!==e&&(u.alpha=e),u}function ea(r){var a=ta(N(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a}var oa=Object.assign({},Vr,{mode:"lab65",alias:["lab-d65"],output:{xyz65:ra,rgb:aa},input:{xyz65:ta,rgb:ea},ranges:{l:[0,100],a:[-86.183,98.234],b:[-107.86,94.478]},parsers:[]});function ia(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=ar(180*Math.atan2(e,t)/Math.PI)),void 0!==o&&(u.alpha=o),u}function ua(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}var ha={mode:"lch",alias:["lch-d50"],output:{lab:ua,rgb:function(r){return Kr(ua(r))}},input:{rgb:function(r){return ia(Ur(r))},lab:ia},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(r){if("string"==typeof r){var a=r.match(m);if(a){var n={mode:"lch",l:+a[1],c:Math.max(0,+a[2]),h:void 0===a[5]?nr(a[3],a[4]):+a[5]};return void 0!==a[6]?n.alpha=a[6]/100:void 0!==a[7]&&(n.alpha=+a[7]),n}}}],interpolate:{h:{use:k,fixup:er},c:k,l:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},la=Object.assign({},ha,{mode:"lch65",alias:["lch-d65"],output:{lab65:function(r){return ua(r,"lab65")},rgb:function(r){return aa(ua(r,"lab65"))}},input:{rgb:function(r){return ia(ea(r),"lch65")},lab65:function(r){return ia(r,"lch65")}},parsers:[],ranges:{l:[0,100],c:[0,133.807],h:[0,360]}}),ca=function(r,a,n){return 4*r/(r+15*a+3*n)},fa=function(r,a,n){return 9*a/(r+15*a+3*n)},pa=ca(Tr,1,Br),da=fa(Tr,1,Br);function sa(r){var a,n=r.x,t=r.y,e=r.z,o=r.alpha,i=(a=t/1)<=Gr?Fr*a:116*Math.cbrt(a)-16,u=ca(n,t,e),h=fa(n,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-pa),h=13*i*(h-da)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l}function va(r){return sa(K(r))}var ba,ga=4*(ba=Tr)/(ba+15*1+3*Br),Ma=function(r,a,n){return 9*a/(r+15*a+3*n)}(Tr,1,Br);function ma(r){var a=r.l,n=r.u,t=r.v,e=r.alpha,o=n/(13*a)+ga,i=t/(13*a)+Ma,u=1*(a<=8?a/Fr:Math.pow((a+16)/116,3)),h={mode:"xyz",x:u*(9*o)/(4*i),y:u,z:u*(12-3*o-20*i)/(4*i)};return void 0!==e&&(h.alpha=e),h}function ya(r){return _(ma(r))}var xa={mode:"luv",output:{xyz:ma,rgb:ya},input:{xyz:sa,rgb:va},channels:["l","u","v","alpha"],ranges:{l:[0,100],u:[-84.86,174.87],v:[-125.744,87.165]},interpolate:{l:k,u:k,v:k,alpha:{use:k,fixup:z}}};function wa(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=ar(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}function ka(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"luv",l:a,u:n?n*Math.cos(t/180*Math.PI):0,v:n?n*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o}var za={mode:"lchuv",output:{luv:ka,rgb:function(r){return ya(ka(r))}},input:{rgb:function(r){return wa(va(r))},luv:wa},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},interpolate:{h:{use:k,fixup:er},c:k,l:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},Pa=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Ia=Math.PI/180,qa=180/Math.PI,ja=Pa[3]*Pa[4],Sa=Pa[1]*Pa[4],Ea=Pa[1]*Pa[2]-Pa[0]*Pa[3];var Oa={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=(Ea*t+a*ja-n*Sa)/(Ea+ja-Sa),i=t-o,u=(Pa[4]*(n-o)-Pa[2]*i)/Pa[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(Pa[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*qa-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)*Ia;var i=void 0===n?0:n*t*(1-t),u=Math.cos(a),h=Math.sin(a);return o.r=t+i*(Pa[0]*u+Pa[1]*h),o.g=t+i*(Pa[2]*u+Pa[3]*h),o.b=t+i*(Pa[4]*u+Pa[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:k,fixup:er},s:k,l:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};function Aa(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=ar(180*Math.atan2(t,n)/Math.PI)),void 0!==e&&(i.alpha=e),i}var Ca=26/180*Math.PI,Ra=Math.cos(Ca),Na=Math.sin(Ca),Ha=100/Math.log(1.39);function $a(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"lab65",l:(Math.exp(1*a/Ha)-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-Ca),h=i*Math.sin(t/180*Math.PI-Ca);o.a=u*Ra-h/.83*Na,o.b=u*Na+h/.83*Ra}return void 0!==e&&(o.alpha=e),o}function Da(r){return $a(Aa(r))}function La(r){var a=r.l,n=r.a,t=r.b,e=r.alpha,o=n*Ra+t*Na,i=.83*(t*Ra-n*Na),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:Ha/1*Math.log(1+.0039*a),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=ar((Math.atan2(i,o)+Ca)/Math.PI*180)),void 0!==e&&(h.alpha=e),h}function Ta(r){var a=r.l,n=r.c,t=r.h,e=r.alpha,o={mode:"dlab",l:a,a:0===n?0:n*Math.cos(t/180*Math.PI),b:0===n?0:n*Math.sin(t/180*Math.PI)};return void 0!==e&&(o.alpha=e),o}function Ba(r){return Ta(La(r))}var Fa={mode:"dlab",output:{lab65:Da,rgb:function(r){return aa(Da(r))}},input:{lab65:Ba,rgb:function(r){return Ba(ea(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.5],b:[-40.47,44.344]},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:z}}},Ga={mode:"dlch",output:{lab65:$a,dlab:Ta,rgb:function(r){return aa($a(r))}},input:{lab65:La,dlab:Aa,rgb:function(r){return La(ea(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:er},alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},Wa={mode:"xyz",alias:["xyz-d50"],output:{rgb:_,lab:Qr},input:{rgb:K,lab:_r},channels:["x","y","z","alpha"],ranges:{x:[0,.962],y:[0,.997],z:[0,.823]},interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:z}}};var _a={mode:"xyz65",alias:["xyz-d65"],output:{rgb:H,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,.946],y:[0,.995],z:[0,1.083]},channels:["x","y","z","alpha"],interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:z}}};var Ka={mode:"yiq",output:{rgb:function(r){var a=r.y,n=r.i,t=r.q;return S({r:a+.95608445*n+.6208885*t,g:a-.27137664*n-.6486059*t,b:a-1.10561724*n+1.70250126*t,alpha:r.alpha})}},input:{rgb:function(r){var a=q(r),n=a.r,t=a.g,e=a.b,o=a.alpha,i={mode:"yiq",y:.29889531*n+.58662247*t+.11448223*e,i:.59597799*n-.2741761*t-.32180189*e,q:.21147017*n-.52261711*t+.31114694*e};return void 0!==o&&(i.alpha=o),i}},channels:["y","i","q","alpha"],ranges:{i:[-.593,.593],q:[-.52,.52]},interpolate:{y:k,i:k,q:k,alpha:{use:k,fixup:z}}};function Ja(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.0767245293*o-3.3072168827*i+.2307590544*u,g:-1.2681437731*o+2.6093323231*i-.341134429*u,b:-.0041119885*o-.7034763098*i+1.7068625689*u};return void 0!==e&&(h.alpha=e),h}function Qa(r){var a=r.r,n=r.g,t=r.b,e=r.alpha,o=Math.cbrt(.412165612*a+.536275208*n+.0514575653*t),i=Math.cbrt(.211859107*a+.6807189584*n+.107406579*t),u=Math.cbrt(.0883097947*a+.2818474174*n+.6302613616*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}function Ua(r){var a=Qa(q(r));return r.r===r.b&&r.b===r.g&&(a.a=a.b=0),a}function Va(r){return S(Ja(r))}var Xa=Object.assign({},Vr,{mode:"oklab",alias:[],output:{lrgb:Ja,rgb:Va},input:{lrgb:Qa,rgb:Ua},ranges:{l:[0,1],a:[-.233,.276],b:[-.311,.198]},parsers:[]}),Ya=Object.assign({},ha,{mode:"oklch",alias:[],output:{oklab:function(r){return ua(r,"oklab")},rgb:function(r){return Va(ua(r,"oklab"))}},input:{rgb:function(r){return ia(Ua(r),"oklch")},oklab:function(r){return ia(r,"oklch")}},parsers:[],ranges:{l:[0,1],c:[0,.322],h:[0,360]}});function Za(r){return void 0===r&&(r=4),function(a){return"number"==typeof a?function(r,a){return Math.round(r*(a=Math.pow(10,a)))/a}(a,r):a}}function rn(r){return Math.round(255*Math.max(0,Math.min(r,1)))}var an=dr("rgb"),nn=Za(2),tn=function(r){var a=an(r);if(void 0!==a)return"#"+(1<<24|rn(a.r)<<16|rn(a.g)<<8|rn(a.b)).toString(16).slice(1)},en=function(r){var a=an(r);if(void 0!==a){var n=rn(a.r),t=rn(a.g),e=rn(a.b);return void 0===a.alpha||1===a.alpha?"rgb("+n+", "+t+", "+e+")":"rgba("+n+", "+t+", "+e+", "+nn(a.alpha)+")"}};function on(r){return void 0===r&&(r=.5),function(a){return r<=0?1:r>=1?0:Math.pow(a,Math.log(.5)/Math.log(r))}}var un=function(r,a,n){void 0===a&&(a="rgb"),void 0===n&&(n=!1);var t=a?cr(a).channels:null,e=a?dr(a):pr;return function(o){var i=e(o),u=(t||cr(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=pr(o);return h&&h.mode!==u.mode?dr(h.mode)(u):u}},hn=function(r,a,n){return"alpha"!==a?(r||0)*(void 0!==n.alpha?n.alpha:1):r},ln=function(r,a,n){return"alpha"!==a&&0!==n.alpha?(r||0)/(void 0!==n.alpha?n.alpha:1):r},cn=function(r,a){return void 0===r&&(r=1),void 0===a&&(a=0),function(n,t){return"alpha"!==t?n*r+a:n}},fn=function(r){return"function"==typeof r},pn=function(r){return r&&"object"==typeof r},dn=function(r){return"number"==typeof r},sn=function(r,a,n,t){void 0===a&&(a="rgb");var e=cr(a),o=dr(a),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):dn(r)||fn(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=pn(n)&&pn(n[a])&&n[a].fixup?n[a].fixup:pn(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 f=e.channels.reduce((function(r,a){var t;return fn(n)?t=n:pn(n)&&fn(n[a])?t=n[a]:pn(n)&&pn(n[a])&&n[a].use?t=n[a].use:fn(e.interpolate[a])?t=e.interpolate[a]:pn(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&&(dn(c)&&(c=on((c-t)/o)),l=c(l));var d=(n-1+l)/p;return e.channels.reduce((function(r,a){var n=f[a](d);return void 0!==n&&(r[a]=n),r}),{mode:a})}},vn=function(r,a){return function(n,t,e){void 0===t&&(t="rgb");var o=a?un(a,t):void 0,i=sn(n,t,e,r);return o?function(r){return o(i(r))}:i}},bn=vn(hn,ln);function gn(r){return(1-Math.cos(r*Math.PI))/2}var Mn=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},mn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return Mn(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)}},yn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return Mn(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(a-t/n)*n)}},xn=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},wn=function(r){return mn(xn(r))},kn=function(r){return yn(xn(r))},zn=Math.sign,Pn=Math.min,In=Math.abs,qn=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?(zn(n[o-1])+zn(n[o]))*Pn(In(n[o-1]),In(n[o]),.5*In(t[o])):void 0);return[n,t,e]},jn=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]}},Sn=function(r){if(r.length<3)return k(r);var a=r.length-1,n=qn(r),t=n[0],e=n[2];return e[0]=t[0],e[a]=t[a-1],jn(r,e,t)},En=function(r){var a=r.length-1,n=qn(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]=(zn(i)+zn(t[0]))*Pn(In(i),In(t[0]),.5*In(e[0])),o[a]=(zn(t[a-1])+zn(u))*Pn(In(t[a-1]),In(u),.5*In(e[a])),jn(r,o,t)};var On=dr("rgb");function An(r){var a=On(r);return void 0!==a&&a.r>=0&&a.r<=1&&a.g>=0&&a.g<=1&&a.b>=0&&a.b<=1}var Cn=dr("lch"),Rn=dr("rgb"),Nn=function(r){var a=Rn(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},Hn=function(r){return void 0===(r=pr(r))||An(r)?r:dr(r.mode)(Nn(r))},$n=function(r){if(void 0===(r=pr(r))||An(r))return r;var a=dr(r.mode);r=Cn(r);var n=Object.assign({},r,{c:0});if(!An(n))return a(Nn(r));for(var t=0,e=r.c;e-t>.01;)n.c=t+.5*(e-t),An(n)?t=n.c:e=n.c;return a(n)};var Dn={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 Ln(r){var a=dr("lrgb")(r);return.2126*a.r+.7152*a.g+.0722*a.b}var Tn=dr("rgb"),Bn=[[1,0,-0,0,1,0,-0,-0,1],[.856167,.182038,-.038205,.029342,.955115,.015544,-.00288,-.001563,1.004443],[.734766,.334872,-.069637,.05184,.919198,.028963,-.004928,-.004209,1.009137],[.630323,.465641,-.095964,.069181,.890046,.040773,-.006308,-.007724,1.014032],[.539009,.579343,-.118352,.082546,.866121,.051332,-.007136,-.011959,1.019095],[.458064,.679578,-.137642,.092785,.846313,.060902,-.007494,-.016807,1.024301],[.38545,.769005,-.154455,.100526,.829802,.069673,-.007442,-.02219,1.029632],[.319627,.849633,-.169261,.106241,.815969,.07779,-.007025,-.028051,1.035076],[.259411,.923008,-.18242,.110296,.80434,.085364,-.006276,-.034346,1.040622],[.203876,.990338,-.194214,.112975,.794542,.092483,-.005222,-.041043,1.046265],[.152286,1.052583,-.204868,.114503,.786281,.099216,-.003882,-.048116,1.051998]],Fn=[[1,0,-0,0,1,0,-0,-0,1],[.866435,.177704,-.044139,.049567,.939063,.01137,-.003453,.007233,.99622],[.760729,.319078,-.079807,.090568,.889315,.020117,-.006027,.013325,.992702],[.675425,.43385,-.109275,.125303,.847755,.026942,-.00795,.018572,.989378],[.605511,.52856,-.134071,.155318,.812366,.032316,-.009376,.023176,.9862],[.547494,.607765,-.155259,.181692,.781742,.036566,-.01041,.027275,.983136],[.498864,.674741,-.173604,.205199,.754872,.039929,-.011131,.030969,.980162],[.457771,.731899,-.18967,.226409,.731012,.042579,-.011595,.034333,.977261],[.422823,.781057,-.203881,.245752,.709602,.044646,-.011843,.037423,.974421],[.392952,.82361,-.216562,.263559,.69021,.046232,-.01191,.040281,.97163],[.367322,.860646,-.227968,.280085,.672501,.047413,-.01182,.04294,.968881]],Gn=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],Wn=function(r,a){var n=Math.max(0,Math.min(1,a)),t=Math.round(n/.1),e=Math.round(n%.1),o=r[t];if(e>0&&t<r.length-1){var i=r[t+1];o=o.map((function(r,a){return y(o[a],i[a],e)}))}return function(r){var a=pr(r);if(void 0!==a){var n=Tn(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),dr(a.mode)(u)}}},_n=function(r){return void 0===r&&(r=1),Wn(Bn,r)},Kn=function(r){return void 0===r&&(r=1),Wn(Fn,r)},Jn=function(r){return void 0===r&&(r=1),Wn(Gn,r)};var Qn=function(r){return Math.max(r,0)},Un=function(r){return Math.max(Math.min(r,1),0)},Vn=function(r,a,n){void 0===n&&(n=!1);var t=dr(a),e=cr(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 f=pr(o);return f&&h.mode!==f.mode?dr(f.mode)(h):h}}};lr($),lr(Oa),lr(Fa),lr(Ga),lr(Pr),lr(xr),lr(zr),lr(Ir),lr(Hr),lr(Lr),lr(Vr),lr(oa),lr(ha),lr(la),lr(za),lr(E),lr(xa),lr(T),lr(J),lr(rr),lr(P),lr(_a),lr(Wa),lr(Ka),lr(Xa),lr(Ya);var Xn=dr("a98"),Yn=dr("cubehelix"),Zn=dr("dlab"),rt=dr("dlch"),at=dr("hsi"),nt=dr("hsl"),tt=dr("hsv"),et=dr("hwb"),ot=dr("jab"),it=dr("jch"),ut=dr("lab"),ht=dr("lab65"),lt=dr("lch"),ct=dr("lch65"),ft=dr("lchuv"),pt=dr("lrgb"),dt=dr("luv"),st=dr("p3"),vt=dr("prophoto"),bt=dr("rec2020"),gt=dr("rgb"),Mt=dr("xyz"),mt=dr("xyz65"),yt=dr("yiq"),xt=dr("oklab"),wt=dr("oklch");r.a98=Xn,r.average=function(r,a,n){void 0===a&&(a="rgb");var t=cr(a),e=r.map(dr(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=yr(n)?n:n&&yr(n[a])?n[a]:t.average&&yr(t.average[a])?t.average[a]:mr,r[a]=o(i,a));return r}),{mode:a})},r.averageAngle=Mr,r.averageNumber=mr,r.blend=function(r,a,n){void 0===a&&(a="normal"),void 0===n&&(n="rgb");var t="function"==typeof a?a:Dn[a],e=dr(n),o=cr(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 Hn;case"lch":return $n}},r.clampChroma=$n,r.clampRgb=Hn,r.colorsNamed=n,r.converter=dr,r.cubehelix=Yn,r.deficiencyDeuter=Kn,r.deficiencyProt=_n,r.deficiencyTrit=Jn,r.defineMode=lr,r.differenceCie76=function(){return gr("lab65")},r.differenceCie94=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=.045),void 0===n&&(n=.015);var t=dr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,d=u.a,s=u.b,v=Math.sqrt(d*d+s*s),b=Math.pow(h-p,2),g=Math.pow(f-v,2),M=Math.pow(l-d,2)+Math.pow(c-s,2)-g;return Math.sqrt(b/Math.pow(r,2)+g/Math.pow(1+a*f,2)+M/Math.pow(1+n*f,2))}},r.differenceCiede2000=function(r,a,n){void 0===r&&(r=1),void 0===a&&(a=1),void 0===n&&(n=1);var t=dr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,d=u.a,s=u.b,v=(f+Math.sqrt(d*d+s*s))/2,b=.5*(1-Math.sqrt(Math.pow(v,7)/(Math.pow(v,7)+Math.pow(25,7)))),g=l*(1+b),M=d*(1+b),m=Math.sqrt(g*g+c*c),y=Math.sqrt(M*M+s*s),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(s)===0?0:Math.atan2(s,M);w+=2*(w<0)*Math.PI;var k=p-h,z=y-m,P=m*y==0?0:w-x;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var I,q=2*Math.sqrt(m*y)*Math.sin(P/2),j=(h+p)/2,S=(m+y)/2;m*y==0?I=x+w:(I=(x+w)/2,I-=(Math.abs(x-w)>Math.PI)*Math.PI,I+=2*(I<0)*Math.PI);var E=Math.pow(j-50,2),O=1-.17*Math.cos(I-Math.PI/6)+.24*Math.cos(2*I)+.32*Math.cos(3*I+Math.PI/30)-.2*Math.cos(4*I-63*Math.PI/180),A=1+.015*E/Math.sqrt(20+E),C=1+.045*S,R=1+.015*S*O,N=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),H=2*Math.sqrt(Math.pow(S,7)/(Math.pow(S,7)+Math.pow(25,7))),$=-1*Math.sin(2*N)*H;return Math.sqrt(Math.pow(k/(r*A),2)+Math.pow(z/(a*C),2)+Math.pow(q/(n*R),2)+$*z/(a*C)*q/(n*R))}},r.differenceCmc=function(r,a){void 0===r&&(r=1),void 0===a&&(a=1);var n=dr("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 f=n(e),p=f.l,d=f.a,s=f.b,v=Math.sqrt(d*d+s*s),b=Math.pow(i-p,2),g=Math.pow(l-v,2),M=Math.pow(u-d,2)+Math.pow(h-s,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 gr("dlab")},r.differenceEuclidean=gr,r.differenceHueChroma=br,r.differenceHueNaive=vr,r.differenceHueSaturation=sr,r.differenceKotsarenkoRamos=function(){return gr("yiq",[.5053,.299,.1957])},r.displayable=An,r.dlab=Zn,r.dlch=rt,r.easingGamma=x,r.easingInOutSine=gn,r.easingMidpoint=on,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=Qn(r);return un(cn(n),a,!0)},r.filterContrast=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=Qn(r);return un(cn(n,(1-n)/2),a,!0)},r.filterDeficiencyDeuter=Kn,r.filterDeficiencyProt=_n,r.filterDeficiencyTrit=Jn,r.filterGrayscale=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),Vn([.2126+.7874*(n=1-Un(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"),Vn(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=Un(r);return un((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"),Vn(function(r){var a=Qn(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"),Vn([.393+.607*(n=1-Un(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=z,r.fixupHueDecreasing=function(r){return tr(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return tr(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return tr(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=er,r.formatHex=tn,r.formatHex8=function(r){var a=an(r);if(void 0!==a){var n=rn(void 0!==a.alpha?a.alpha:1);return tn(a)+(256|n).toString(16).slice(1)}},r.formatRgb=en,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return en;case"hex":return tn}},r.getModeDefinition=cr,r.hsi=at,r.hsl=nt,r.hsv=tt,r.hwb=et,r.interpolate=function(r,a,n){return void 0===a&&(a="rgb"),sn(r,a,n)},r.interpolateAlpha=z,r.interpolateCosine=function(r,a){return void 0===a&&(a=1),function(n){var t=x(a),e=w((function(r,a,n){return y(r,a,gn(n))}))((r||function(r){return r})(n));return function(r){return e(t(r))}}},r.interpolateHue=er,r.interpolateLinear=function(r,a){return void 0===a&&(a=1),function(n){var t=x(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=x(n);return"default"===a?function(a){return mn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return yn((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=x(n);return"closed"===a?function(a){return En((r||function(r){return r})(t))(e(a))}:"default"===a?function(a){return Sn((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=x(n);return"default"===a?function(a){return wn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return kn((r||function(r){return r})(t))(e(a))}:void 0}},r.interpolateWith=vn,r.interpolateWithPremultipliedAlpha=bn,r.interpolatorLinear=k,r.interpolatorPiecewise=w,r.interpolatorSplineBasis=mn,r.interpolatorSplineBasisClosed=yn,r.interpolatorSplineMonotone=Sn,r.interpolatorSplineMonotone2=function(r){if(r.length<3)return k(r);var a=r.length-1,n=qn(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:In(e[0])>2*In(t[0])?2*t[0]:e[0],o[a]=e[a]*t[a-1]<=0?0:In(e[a])>2*In(t[a-1])?2*t[a-1]:e[a],jn(r,o,t)},r.interpolatorSplineMonotoneClosed=En,r.interpolatorSplineNatural=wn,r.interpolatorSplineNaturalClosed=kn,r.jab=ot,r.jch=it,r.lab=ut,r.lab65=ht,r.lch=lt,r.lch65=ct,r.lchuv=ft,r.lerp=y,r.lrgb=pt,r.luv=dt,r.mapAlphaDivide=ln,r.mapAlphaMultiply=hn,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=cn,r.mapper=un,r.nearest=function(r,a,n){void 0===a&&(a=gr()),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=xt,r.oklch=wt,r.p3=st,r.parse=fr,r.prophoto=vt,r.random=function(r,a){void 0===r&&(r="rgb"),void 0===a&&(a={});var n=cr(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=bt,r.rgb=gt,r.round=Za,r.samples=function(r,a){void 0===r&&(r=2),void 0===a&&(a=1);var n=x(a);if(r<2)return r<1?[]:[n(.5)];for(var t=[],e=0;e<r;e++)t.push(n(e/(r-1)));return t},r.wcagContrast=function(r,a){var n=Ln(r),t=Ln(a);return(Math.max(n,t)+.05)/(Math.min(n,t)+.05)},r.wcagLuminance=Ln,r.xyz=Mt,r.xyz65=mt,r.yiq=yt,Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r="undefined"!=typeof globalThis?globalThis:r||self).culori={})}(this,(function(r){"use strict";var n=function(r,n){if("number"==typeof r)return 3===n?{mode:"rgb",r:(r>>8&15|r>>4&240)/255,g:(r>>4&15|240&r)/255,b:(15&r|r<<4&240)/255}:4===n?{mode:"rgb",r:(r>>12&15|r>>8&240)/255,g:(r>>8&15|r>>4&240)/255,b:(r>>4&15|240&r)/255,alpha:(15&r|r<<4&240)/255}:6===n?{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}:8===n?{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(255&r)/255}:void 0},a={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o=t+"%?",i="(?:"+t+"%|"+t+")",u="(?:"+t+"(deg|grad|rad|turn)|"+t+")",h="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+h+t+h+t+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),f=new RegExp("^rgba?\\(\\s*"+e+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),p=new RegExp("^rgba?\\(\\s*"+t+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),d=new RegExp("^rgba?\\(\\s*"+e+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),s=new RegExp("^hsla?\\(\\s*"+u+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),b=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,g=new RegExp("^hwb\\(\\s*"+u+l+e+l+e+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),M=new RegExp("^lab\\(\\s*"+o+l+t+l+t+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),m=new RegExp("^lch\\(\\s*"+o+l+t+l+u+"\\s*(?:\\/\\s*"+i+"\\s*)?\\)$"),y=function(r,n,a){return r+a*(n-r)},x=function(r){return void 0===r&&(r=1),1===r?function(r){return r}:function(n){return Math.pow(n,r)}},w=function(r){return function(n){var a=function(r){for(var n=[],a=0;a<r.length-1;a++){var t=r[a],e=r[a+1];void 0===t&&void 0===e?n.push(void 0):void 0!==t&&void 0!==e?n.push([t,e]):n.push(void 0!==t?[t,t]:[e,e])}return n}(n);return function(n){var t=n*a.length,e=1===n?a.length-1:Math.floor(t),o=a[e];return void 0===o?void 0:r(o[0],o[1],t-e)}}},k=w(y),z=function(r){var n=!1,a=r.map((function(r){return void 0!==r?(n=!0,r):1}));return n?a:r},P={mode:"rgb",channels:["r","g","b","alpha"],alias:["srgb"],parsers:[function(r){var a;return(a=r.match(b))?n(parseInt(a[1],16),a[1].length):void 0},function(r){var n,a;if(n=r.match(c)||r.match(p))a={mode:"rgb",r:n[1]/255,g:n[2]/255,b:n[3]/255};else{if(!(n=r.match(f)||r.match(d)))return;a={mode:"rgb",r:n[1]/100,g:n[2]/100,b:n[3]/100}}return void 0!==n[4]?a.alpha=n[4]/100:void 0!==n[5]&&(a.alpha=+n[5]),a},function(r){return"string"==typeof r&&n(a[r.toLowerCase()],6)||void 0},function(r){return"transparent"===r?n(0,8):void 0}],interpolate:{r:k,g:k,b:k,alpha:{use:k,fixup:z}}},I=function(r){return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)},q=function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o={mode:"lrgb",r:I(n),g:I(a),b:I(t)};return void 0!==e&&(o.alpha=e),o},j=function(r){return r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r},S=function(r,n){var a=r.r,t=r.g,e=r.b,o=r.alpha;void 0===n&&(n="rgb");var i={mode:n,r:j(a),g:j(t),b:j(e)};return void 0!==o&&(i.alpha=o),i},E=Object.assign({},P,{mode:"lrgb",output:{rgb:S},input:{rgb:q},parsers:[]}),O=function(r){return Math.pow(Math.abs(r),563/256)*Math.sign(r)},A=function(r){var n=O(r.r),a=O(r.g),t=O(r.b),e={mode:"xyz65",x:.5766690429101305*n+.1855582379065463*a+.1882286462349947*t,y:.29734497525053605*n+.6273635662554661*a+.07529145849399788*t,z:.02703136138641234*n+.07068885253582723*a+.9913375368376388*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},C=function(r){return Math.pow(Math.abs(r),256/563)*Math.sign(r)},R=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o={mode:"a98",r:C(2.0415879038107465*n-.5650069742788596*a-.34473135077832956*t),g:C(-.9692436362808795*n+1.8759675015077202*a+.04155505740717557*t),b:C(.013444280632031142*n-.11836239223101838*a+1.0151749943912054*t)};return void 0!==e&&(o.alpha=e),o},N=function(r){var n=q(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"xyz65",x:.4124564*a+.3575761*t+.1804375*e,y:.2126729*a+.7151522*t+.072175*e,z:.0193339*a+.119192*t+.9503041*e};return void 0!==o&&(i.alpha=o),i},H=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=S({r:3.2404542*n-1.5371385*a-.4985314*t,g:-.969266*n+1.8760108*a+.041556*t,b:.0556434*n-.2040259*a+1.0572252*t});return void 0!==e&&(o.alpha=e),o},$=Object.assign({},P,{mode:"a98",alias:["a98-rgb"],parsers:[],input:{rgb:function(r){return R(N(r))},xyz65:R},output:{rgb:function(r){return H(A(r))},xyz65:A}}),D=function(r){var n=q(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"xyz65",x:.4865709*a+.2656676*t+.1982172*e,y:.2289745*a+.6917385*t+.0792869*e,z:0*a+.0451133*t+1.0439443*e};return void 0!==o&&(i.alpha=o),i},L=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=S({r:2.4934969*n-.9313836*a-.4027107*t,g:-.8294889*n+1.762664*a+.0236246*t,b:.0358458*n-.0761723*a+.9568845*t},"p3");return void 0!==e&&(o.alpha=e),o},T=Object.assign({},P,{mode:"p3",alias:["display-p3"],input:{rgb:function(r){return L(N(r))},xyz65:L},output:{rgb:function(r){return H(D(r))},xyz65:D},parsers:[]}),B=function(r){return r>=1/512?Math.pow(r,1/1.8):16*r},F=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o={mode:"prophoto",r:B(1.3457989731028281*n-.25558010007997534*a-.05110628506753401*t),g:B(-.5446224939028347*n+1.5082327413132781*a+.02053603239147973*t),b:B(0*n+0*a+1.2119675456389454*t)};return void 0!==e&&(o.alpha=e),o},G=function(r){return r>=16/512?Math.pow(r,1.8):r/16},W=function(r){var n=G(r.r),a=G(r.g),t=G(r.b),e={mode:"xyz65",x:.7977604896723027*n+.13518583717574031*a+.0313493495815248*t,y:.2880711282292934*n+.7118432178101014*a+8565396060525902e-20*t,z:0*n+0*a+.8251046025104601*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},_=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=S({r:3.1338561*n-1.6168667*a-.4906146*t,g:-.9787684*n+1.9161415*a+.033454*t,b:.0719453*n-.2289914*a+1.4052427*t});return void 0!==e&&(o.alpha=e),o},K=function(r){var n=q(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"xyz",x:.4360747*a+.3850649*t+.1430804*e,y:.2225045*a+.7168786*t+.0606169*e,z:.0139322*a+.0971045*t+.7141733*e};return void 0!==o&&(i.alpha=o),i},J=Object.assign({},P,{mode:"prophoto",alias:["prophoto-rgb"],parsers:[],input:{xyz:F,rgb:function(r){return F(K(r))}},output:{xyz:W,rgb:function(r){return _(W(r))}}}),Q=1.09929682680944,U=function(r){return r>.018053968510807?Q*Math.pow(r,1/2.4)-(Q-1):4.5*r},V=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o={mode:"rec2020",r:U(1.7166511879712674*n-.35567078377639233*a-.25336628137365974*t),g:U(-.6666843518324892*n+1.6164812366349395*a+.01576854581391113*t),b:U(.017639857445310783*n-.042770613257808524*a+.9421031212354738*t)};return void 0!==e&&(o.alpha=e),o},X=1.09929682680944,Y=function(r){return r<.08124285829863151?r/4.5:Math.pow((r+X-1)/X,2.4)},Z=function(r){var n=Y(r.r),a=Y(r.g),t=Y(r.b),e={mode:"xyz65",x:.6369580483012914*n+.14461690358620832*a+.1688809751641721*t,y:.2627002120112671*n+.6779980715188708*a+.05930171646986196*t,z:0*n+.028072693049087428*a+1.060985057710791*t};return void 0!==r.alpha&&(e.alpha=r.alpha),e},rr=Object.assign({},P,{mode:"rec2020",input:{xyz:V,rgb:function(r){return V(N(r))}},output:{xyz:Z,rgb:function(r){return H(Z(r))}},parsers:[]}),nr=function(r){return(r%=360)<0?r+360:r};var ar=function(r,n){switch(n){case"deg":return+r;case"rad":return r/Math.PI*180;case"grad":return r/10*9;case"turn":return 360*r}},tr=function(r,n){return r.map((function(a,t,e){if(void 0===a)return a;var o=nr(a);return 0===t||void 0===r[t-1]?o:n(o-nr(e[t-1]))})).reduce((function(r,n){return r.length&&void 0!==n&&void 0!==r[r.length-1]?(r.push(n+r[r.length-1]),r):(r.push(n),r)}),[])},er=function(r){return tr(r,(function(r){return Math.abs(r)<=180?r:r-360*Math.sign(r)}))},or={},ir={},ur=[],hr=function(r){return r},lr=function(r){or[r.mode]=Object.assign(or[r.mode]||{},r.output),Object.keys(r.input||{}).forEach((function(n){or[n]||(or[n]={}),or[n][r.mode]=r.input[n]})),r.ranges||(r.ranges={}),r.difference||(r.difference={}),r.channels.forEach((function(n){if(void 0===r.ranges[n]&&(r.ranges[n]=[0,1]),!r.interpolate[n])throw new Error("Missing interpolator for: "+n);"function"==typeof r.interpolate[n]&&(r.interpolate[n]={use:r.interpolate[n]}),r.interpolate[n].fixup||(r.interpolate[n].fixup=hr)})),ir[r.mode]=r,(r.parsers||[]).forEach((function(r){return ur.push(r)}))},cr=function(r){return ir[r]},fr=function(r){for(var n,a=0,t=ur.length;a<t&&void 0===(n=ur[a++](r)););return n},pr=function(r,n){return void 0===r?void 0:"object"!=typeof r?fr(r):void 0!==r.mode?r:n?Object.assign({},r,{mode:n}):void 0},dr=function(r){return void 0===r&&(r="rgb"),function(n){return void 0!==(n=pr(n,r))?n.mode===r?n:or[n.mode][r]?or[n.mode][r](n):"rgb"===r?or[n.mode].rgb(n):or.rgb[r](or[n.mode].rgb(n)):void 0}},sr=function(r,n){if(void 0===r.h||void 0===n.h||!r.s||!n.s)return 0;var a=nr(r.h),t=nr(n.h),e=Math.sin((t-a+360)/2*Math.PI/180);return 2*Math.sqrt(r.s*n.s)*e},vr=function(r,n){if(void 0===r.h||void 0===n.h)return 0;var a=nr(r.h),t=nr(n.h);return Math.abs(t-a)>180?a-(t-360*Math.sign(t-a)):t-a},br=function(r,n){if(void 0===r.h||void 0===n.h||!r.c||!n.c)return 0;var a=nr(r.h),t=nr(n.h),e=Math.sin((t-a+360)/2*Math.PI/180);return 2*Math.sqrt(r.c*n.c)*e},gr=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n=[1,1,1,0]);var a=cr(r),t=a.channels,e=a.difference,o=dr(r);return function(r,a){var i=o(r),u=o(a);return Math.sqrt(t.reduce((function(r,a,t){var o=e[a]?e[a](i,u):i[a]-u[a];return r+(n[t]||0)*Math.pow(isNaN(o)?0:o,2)}),0))}},Mr=function(r){var n=r.reduce((function(r,n){if(void 0!==n){var a=n*Math.PI/180;r.sin+=Math.sin(a),r.cos+=Math.cos(a)}return r}),{sin:0,cos:0});return 180*Math.atan2(n.sin,n.cos)/Math.PI},mr=function(r){var n=r.filter((function(r){return void 0!==r}));return n.length?n.reduce((function(r,n){return r+n}),0)/n.length:void 0},yr=function(r){return"function"==typeof r};var xr={mode:"hsl",output:{rgb:function(r){var n=r.h,a=r.s,t=r.l,e=r.alpha;n=nr(n);var o,i=t+a*(t<.5?t:1-t),u=i-2*(i-t)*Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:i,g:u,b:2*t-i};break;case 1:o={r:u,g:i,b:2*t-i};break;case 2:o={r:2*t-i,g:i,b:u};break;case 3:o={r:2*t-i,g:u,b:i};break;case 4:o={r:u,g:2*t-i,b:i};break;case 5:o={r:i,g:2*t-i,b:u};break;default:o={r:2*t-i,g:2*t-i,b:2*t-i}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","l","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(s)||r.match(v);if(n){var a={mode:"hsl",h:void 0===n[3]?ar(n[1],n[2]):+n[3],s:Math.min(Math.max(0,n[4]/100),1),l:Math.min(Math.max(0,n[5]/100),1)};return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=+n[7]),a}}}],interpolate:{h:{use:k,fixup:er},s:k,l:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};function wr(r){var n=r.h,a=r.s,t=r.v,e=r.alpha;n=nr(n);var o,i=Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:t,g:t*(1-a*i),b:t*(1-a)};break;case 1:o={r:t*(1-a*i),g:t,b:t*(1-a)};break;case 2:o={r:t*(1-a),g:t,b:t*(1-a*i)};break;case 3:o={r:t*(1-a),g:t*(1-a*i),b:t};break;case 4:o={r:t*(1-a*i),g:t*(1-a),b:t};break;case 5:o={r:t,g:t*(1-a),b:t*(1-a*i)};break;default:o={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}function kr(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}var zr={mode:"hsv",output:{rgb:wr},input:{rgb:kr},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:er},s:k,v:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};var Pr={mode:"hsi",output:{rgb:function(r){var n=r.h,a=r.s,t=r.i,e=r.alpha;n=nr(n);var o,i=Math.abs(n/60%2-1);switch(Math.floor(n/60)){case 0:o={r:t*(1+a*(3/(2-i)-1)),g:t*(1+a*(3*(1-i)/(2-i)-1)),b:t*(1-a)};break;case 1:o={r:t*(1+a*(3*(1-i)/(2-i)-1)),g:t*(1+a*(3/(2-i)-1)),b:t*(1-a)};break;case 2:o={r:t*(1-a),g:t*(1+a*(3/(2-i)-1)),b:t*(1+a*(3*(1-i)/(2-i)-1))};break;case 3:o={r:t*(1-a),g:t*(1+a*(3*(1-i)/(2-i)-1)),b:t*(1+a*(3/(2-i)-1))};break;case 4:o={r:t*(1+a*(3*(1-i)/(2-i)-1)),g:t*(1-a),b:t*(1+a*(3/(2-i)-1))};break;case 5:o={r:t*(1+a*(3/(2-i)-1)),g:t*(1-a),b:t*(1+a*(3*(1-i)/(2-i)-1))};break;default:o={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return o.mode="rgb",void 0!==e&&(o.alpha=e),o}},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.max(n,a,t),i=Math.min(n,a,t),u={mode:"hsi",s:n+a+t===0?0:1-3*i/(n+a+t),i:(n+a+t)/3};return o-i!=0&&(u.h=60*(o===n?(a-t)/(o-i)+6*(a<t):o===a?(t-n)/(o-i)+2:(n-a)/(o-i)+4)),void 0!==e&&(u.alpha=e),u}},channels:["h","s","i","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:k,fixup:er},s:k,i:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}};var Ir,qr={mode:"hwb",output:{rgb:function(r){var n=r.h,a=r.w,t=r.b;if(a+t>1){var e=a+t;a/=e,t/=e}return wr({h:n,s:1===t?1:1-a/(1-t),v:1-t,alpha:r.alpha})}},input:{rgb:function(r){var n=kr(r);if(void 0!==n){var a={mode:"hwb",w:(1-n.s)*n.v,b:1-n.v};return void 0!==n.h&&(a.h=n.h),void 0!==n.alpha&&(a.alpha=n.alpha),a}}},channels:["h","w","b","alpha"],ranges:{h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(g);if(n){var a={mode:"hwb",h:void 0===n[3]?ar(n[1],n[2]):+n[3],w:n[4]/100,b:n[5]/100};if(a.w+a.b>1){var t=a.w+a.b;a.w/=t,a.b/=t}return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=+n[7]),a}}}],interpolate:{h:{use:k,fixup:er},w:k,b:k,alpha:{use:k,fixup:z}},difference:{h:vr},average:{h:Mr}},jr=function(r){var n=Math.pow(r/1e4,.1593017578125);return Math.pow((.8359375+18.8515625*n)/(1+18.6875*n),134.03437499999998)},Sr=function(r){return Math.max(203*r,0)},Er=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha;n=Sr(n),a=Sr(a);var o=1.15*n-.15*(t=Sr(t)),i=.66*a+.34*n,u=jr(.41478972*o+.579999*i+.014648*t),h=jr(-.20151*o+1.120649*i+.0531008*t),l=jr(-.0166008*o+.2648*i+.6684799*t),c=(u+h)/2,f={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&&(f.alpha=e),f},Or=16295499532821565e-27,Ar=function(r){var n=Math.pow(r,.007460772656268216);return 1e4*Math.pow((.8359375-n)/(18.6875*n-18.8515625),6.277394636015326)},Cr=function(r){return r/203},Rr=function(r){var n=r.j,a=r.a,t=r.b,e=r.alpha,o=(n+Or)/(.44+.56*(n+Or)),i=Ar(o+.13860504*a+.058047316*t),u=Ar(o-.13860504*a-.058047316*t),h=Ar(o-.096019242*a-.8118919*t),l={mode:"xyz65",x:Cr(1.661373024652174*i-.914523081304348*u+.23136208173913045*h),y:Cr(-.3250758611844533*i+1.571847026732543*u-.21825383453227928*h),z:Cr(-.090982811*i-.31272829*u+1.5227666*h)};return void 0!==e&&(l.alpha=e),l},Nr=function(r){var n=Er(N(r));return r.r===r.b&&r.b===r.g&&(n.a=n.b=0),n},Hr=function(r){return H(Rr(r))},$r={mode:"jab",channels:["j","a","b","alpha"],input:{rgb:Nr,xyz65:Er},output:{rgb:Hr,xyz65:Rr},ranges:{j:[0,.221],a:[-.108,.129],b:[-.185,.134]},interpolate:{j:k,a:k,b:k,alpha:{use:k,fixup:z}}},Dr=function(r){var n=r.j,a=r.a,t=r.b,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"jch",j:n,c:o};return o&&(i.h=nr(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i},Lr=function(r){var n=r.j,a=r.c,t=r.h,e=r.alpha,o={mode:"jab",j:n,a:a?a*Math.cos(t/180*Math.PI):0,b:a?a*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o},Tr={mode:"jch",output:{lab:Lr,rgb:function(r){return Hr(Lr(r))}},input:{rgb:function(r){return Dr(Nr(r))},lab:Dr},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:k,fixup:er},c:k,j:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},Br=.96422,Fr=.82521,Gr=Math.pow(29,3)/Math.pow(3,3),Wr=Math.pow(6,3)/Math.pow(29,3),_r=function(r){return Math.pow(r,3)>Wr?Math.pow(r,3):(116*r-16)/Gr},Kr=function(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=(n+16)/116,i=o-t/200,u={mode:"xyz",x:_r(a/500+o)*Br,y:1*_r(o),z:_r(i)*Fr};return void 0!==e&&(u.alpha=e),u},Jr=function(r){return _(Kr(r))},Qr=function(r){return r>Wr?Math.cbrt(r):(Gr*r+16)/116},Ur=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=Qr(n/Br),i=Qr(a/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-Qr(t/Fr))};return void 0!==e&&(u.alpha=e),u},Vr=function(r){var n=Ur(K(r));return r.r===r.b&&r.b===r.g&&(n.a=n.b=0),n},Xr={mode:"lab",alias:["lab-d50"],output:{xyz:Kr,rgb:Jr},input:{xyz:Ur,rgb:Vr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-79.167,93.408],b:[-111.859,93.246]},parsers:[function(r){if("string"==typeof r){var n=r.match(M);if(n){var a={mode:"lab",l:+n[1],a:+n[2],b:+n[3]};return void 0!==n[4]?a.alpha=n[4]/100:void 0!==n[5]&&(a.alpha=+n[5]),a}}}],interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:z}}},Yr=Math.pow(29,3)/Math.pow(3,3),Zr=Math.pow(6,3)/Math.pow(29,3),rn=function(r){return Math.pow(r,3)>Zr?Math.pow(r,3):(116*r-16)/Yr},nn=function(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=(n+16)/116,i=o-t/200,u={mode:"xyz65",x:.95047*rn(a/500+o),y:1*rn(o),z:1.08883*rn(i)};return void 0!==e&&(u.alpha=e),u},an=function(r){return H(nn(r))},tn=function(r){return r>Zr?Math.cbrt(r):(Yr*r+16)/116},en=function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o=tn(n/.95047),i=tn(a/1),u={mode:"lab65",l:116*i-16,a:500*(o-i),b:200*(i-tn(t/1.08883))};return void 0!==e&&(u.alpha=e),u},on=function(r){var n=en(N(r));return r.r===r.b&&r.b===r.g&&(n.a=n.b=0),n},un=Object.assign({},Xr,{mode:"lab65",alias:["lab-d65"],output:{xyz65:nn,rgb:an},input:{xyz65:en,rgb:on},ranges:{l:[0,100],a:[-86.183,98.234],b:[-107.86,94.478]},parsers:[]}),hn=function(r,n){var a=r.l,t=r.a,e=r.b,o=r.alpha;void 0===n&&(n="lch");var i=Math.sqrt(t*t+e*e),u={mode:n,l:a,c:i};return i&&(u.h=nr(180*Math.atan2(e,t)/Math.PI)),void 0!==o&&(u.alpha=o),u},ln=function(r,n){var a=r.l,t=r.c,e=r.h,o=r.alpha;void 0===n&&(n="lab");var i={mode:n,l:a,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},cn={mode:"lch",alias:["lch-d50"],output:{lab:ln,rgb:function(r){return Jr(ln(r))}},input:{rgb:function(r){return hn(Vr(r))},lab:hn},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},parsers:[function(r){if("string"==typeof r){var n=r.match(m);if(n){var a={mode:"lch",l:+n[1],c:Math.max(0,+n[2]),h:void 0===n[5]?ar(n[3],n[4]):+n[5]};return void 0!==n[6]?a.alpha=n[6]/100:void 0!==n[7]&&(a.alpha=+n[7]),a}}}],interpolate:{h:{use:k,fixup:er},c:k,l:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},fn=Object.assign({},cn,{mode:"lch65",alias:["lch-d65"],output:{lab65:function(r){return ln(r,"lab65")},rgb:function(r){return an(ln(r,"lab65"))}},input:{rgb:function(r){return hn(on(r),"lch65")},lab65:function(r){return hn(r,"lch65")}},parsers:[],ranges:{l:[0,100],c:[0,133.807],h:[0,360]}}),pn=function(r,n,a){return 4*r/(r+15*n+3*a)},dn=function(r,n,a){return 9*n/(r+15*n+3*a)},sn=pn(Br,1,Fr),vn=dn(Br,1,Fr),bn=function(r){var n,a=r.x,t=r.y,e=r.z,o=r.alpha,i=(n=t/1)<=Wr?Gr*n:116*Math.cbrt(n)-16,u=pn(a,t,e),h=dn(a,t,e);isFinite(u)&&isFinite(h)?(u=13*i*(u-sn),h=13*i*(h-vn)):i=u=h=0;var l={mode:"luv",l:i,u:u,v:h};return void 0!==o&&(l.alpha=o),l},gn=function(r){return bn(K(r))},Mn=4*(Ir=Br)/(Ir+15*1+3*Fr),mn=function(r,n,a){return 9*n/(r+15*n+3*a)}(Br,1,Fr),yn=function(r){var n=r.l,a=r.u,t=r.v,e=r.alpha,o=a/(13*n)+Mn,i=t/(13*n)+mn,u=1*(n<=8?n/Gr:Math.pow((n+16)/116,3)),h={mode:"xyz",x:u*(9*o)/(4*i),y:u,z:u*(12-3*o-20*i)/(4*i)};return void 0!==e&&(h.alpha=e),h},xn=function(r){return _(yn(r))},wn={mode:"luv",output:{xyz:yn,rgb:xn},input:{xyz:bn,rgb:gn},channels:["l","u","v","alpha"],ranges:{l:[0,100],u:[-84.86,174.87],v:[-125.744,87.165]},interpolate:{l:k,u:k,v:k,alpha:{use:k,fixup:z}}},kn=function(r){var n=r.l,a=r.u,t=r.v,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"lchuv",l:n,c:o};return o&&(i.h=nr(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i},zn=function(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"luv",l:n,u:a?a*Math.cos(t/180*Math.PI):0,v:a?a*Math.sin(t/180*Math.PI):0};return void 0!==e&&(o.alpha=e),o},Pn={mode:"lchuv",output:{luv:zn,rgb:function(r){return xn(zn(r))}},input:{rgb:function(r){return kn(gn(r))},luv:kn},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},interpolate:{h:{use:k,fixup:er},c:k,l:k,alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},In=[-.14861,1.78277,-.29227,-.90649,1.97294,0],qn=Math.PI/180,jn=180/Math.PI,Sn=In[3]*In[4],En=In[1]*In[4],On=In[1]*In[2]-In[0]*In[3],An={mode:"cubehelix",channels:["h","s","l","alpha"],ranges:{h:[0,360],s:[0,4.6143]},input:{rgb:function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=(On*t+n*Sn-a*En)/(On+Sn-En),i=t-o,u=(In[4]*(a-o)-In[2]*i)/In[3],h={mode:"cubehelix",l:o,s:0===o||1===o?void 0:Math.sqrt(i*i+u*u)/(In[4]*o*(1-o))};return h.s&&(h.h=Math.atan2(u,i)*jn-120),void 0!==e&&(h.alpha=e),h}},output:{rgb:function(r){var n=r.h,a=r.s,t=r.l,e=r.alpha,o={mode:"rgb"};n=(void 0===n?0:n+120)*qn;var i=void 0===a?0:a*t*(1-t),u=Math.cos(n),h=Math.sin(n);return o.r=t+i*(In[0]*u+In[1]*h),o.g=t+i*(In[2]*u+In[3]*h),o.b=t+i*(In[4]*u+In[5]*h),void 0!==e&&(o.alpha=e),o}},interpolate:{h:{use:k,fixup:er},s:k,l:k,alpha:{use:k,fixup:z}},difference:{h:sr},average:{h:Mr}},Cn=function(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=Math.sqrt(a*a+t*t),i={mode:"dlch",l:n,c:o};return o&&(i.h=nr(180*Math.atan2(t,a)/Math.PI)),void 0!==e&&(i.alpha=e),i},Rn=26/180*Math.PI,Nn=Math.cos(Rn),Hn=Math.sin(Rn),$n=100/Math.log(1.39),Dn=function(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"lab65",l:(Math.exp(1*n/$n)-1)/.0039};if(void 0===t)o.a=o.b=0;else{var i=(Math.exp(.0435*a*1*1)-1)/.075,u=i*Math.cos(t/180*Math.PI-Rn),h=i*Math.sin(t/180*Math.PI-Rn);o.a=u*Nn-h/.83*Hn,o.b=u*Hn+h/.83*Nn}return void 0!==e&&(o.alpha=e),o},Ln=function(r){return Dn(Cn(r))},Tn=function(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=a*Nn+t*Hn,i=.83*(t*Nn-a*Hn),u=Math.sqrt(o*o+i*i),h={mode:"dlch",l:$n/1*Math.log(1+.0039*n),c:Math.log(1+.075*u)/.0435};return h.c&&(h.h=nr((Math.atan2(i,o)+Rn)/Math.PI*180)),void 0!==e&&(h.alpha=e),h},Bn=function(r){var n=r.l,a=r.c,t=r.h,e=r.alpha,o={mode:"dlab",l:n,a:0===a?0:a*Math.cos(t/180*Math.PI),b:0===a?0:a*Math.sin(t/180*Math.PI)};return void 0!==e&&(o.alpha=e),o},Fn=function(r){return Bn(Tn(r))},Gn={mode:"dlab",output:{lab65:Ln,rgb:function(r){return an(Ln(r))}},input:{lab65:Fn,rgb:function(r){return Fn(on(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.5],b:[-40.47,44.344]},interpolate:{l:k,a:k,b:k,alpha:{use:k,fixup:z}}},Wn={mode:"dlch",output:{lab65:Dn,dlab:Bn,rgb:function(r){return an(Dn(r))}},input:{lab65:Tn,dlab:Cn,rgb:function(r){return Tn(on(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:er},alpha:{use:k,fixup:z}},difference:{h:br},average:{h:Mr}},_n={mode:"xyz",alias:["xyz-d50"],output:{rgb:_,lab:Ur},input:{rgb:K,lab:Kr},channels:["x","y","z","alpha"],ranges:{x:[0,.962],y:[0,.997],z:[0,.823]},interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:z}}},Kn={mode:"xyz65",alias:["xyz-d65"],output:{rgb:H,xyz:function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o={mode:"xyz",x:1.0478112*n+.0228866*a-.050127*t,y:.0295424*n+.9904844*a-.0170491*t,z:-.0092345*n+.0150436*a+.7521316*t};return void 0!==e&&(o.alpha=e),o}},input:{rgb:N,xyz:function(r){var n=r.x,a=r.y,t=r.z,e=r.alpha,o={mode:"xyz65",x:.9555766*n-.0230393*a+.0631636*t,y:-.0282895*n+1.0099416*a+.0210077*t,z:.0122982*n-.020483*a+1.3299098*t};return void 0!==e&&(o.alpha=e),o}},ranges:{x:[0,.946],y:[0,.995],z:[0,1.083]},channels:["x","y","z","alpha"],interpolate:{x:k,y:k,z:k,alpha:{use:k,fixup:z}}},Jn={mode:"yiq",output:{rgb:function(r){var n=r.y,a=r.i,t=r.q,e=r.alpha;return S({r:n+.95608445*a+.6208885*t,g:n-.27137664*a-.6486059*t,b:n-1.10561724*a+1.70250126*t,alpha:e})}},input:{rgb:function(r){var n=q(r),a=n.r,t=n.g,e=n.b,o=n.alpha,i={mode:"yiq",y:.29889531*a+.58662247*t+.11448223*e,i:.59597799*a-.2741761*t-.32180189*e,q:.21147017*a-.52261711*t+.31114694*e};return void 0!==o&&(i.alpha=o),i}},channels:["y","i","q","alpha"],ranges:{i:[-.593,.593],q:[-.52,.52]},interpolate:{y:k,i:k,q:k,alpha:{use:k,fixup:z}}},Qn=function(r){var n=r.l,a=r.a,t=r.b,e=r.alpha,o=Math.pow(n+.3963377774*a+.2158037573*t,3),i=Math.pow(n-.1055613458*a-.0638541728*t,3),u=Math.pow(n-.0894841775*a-1.291485548*t,3),h={mode:"lrgb",r:4.0767245293*o-3.3072168827*i+.2307590544*u,g:-1.2681437731*o+2.6093323231*i-.341134429*u,b:-.0041119885*o-.7034763098*i+1.7068625689*u};return void 0!==e&&(h.alpha=e),h},Un=function(r){var n=r.r,a=r.g,t=r.b,e=r.alpha,o=Math.cbrt(.412165612*n+.536275208*a+.0514575653*t),i=Math.cbrt(.211859107*n+.6807189584*a+.107406579*t),u=Math.cbrt(.0883097947*n+.2818474174*a+.6302613616*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},Vn=function(r){var n=Un(q(r));return r.r===r.b&&r.b===r.g&&(n.a=n.b=0),n},Xn=function(r){return S(Qn(r))},Yn=Object.assign({},Xr,{mode:"oklab",alias:[],output:{lrgb:Qn,rgb:Xn},input:{lrgb:Un,rgb:Vn},ranges:{l:[0,1],a:[-.233,.276],b:[-.311,.198]},parsers:[]}),Zn=Object.assign({},cn,{mode:"oklch",alias:[],output:{oklab:function(r){return ln(r,"oklab")},rgb:function(r){return Xn(ln(r,"oklab"))}},input:{rgb:function(r){return hn(Vn(r),"oklch")},oklab:function(r){return hn(r,"oklch")}},parsers:[],ranges:{l:[0,1],c:[0,.322],h:[0,360]}}),ra=function(r){return void 0===r&&(r=4),function(n){return"number"==typeof n?function(r,n){return Math.round(r*(n=Math.pow(10,n)))/n}(n,r):n}},na=function(r){return Math.round(255*Math.max(0,Math.min(r,1)))},aa=dr("rgb"),ta=ra(2),ea=function(r){var n=aa(r);if(void 0!==n)return"#"+(1<<24|na(n.r)<<16|na(n.g)<<8|na(n.b)).toString(16).slice(1)},oa=function(r){var n=aa(r);if(void 0!==n){var a=na(n.r),t=na(n.g),e=na(n.b);return void 0===n.alpha||1===n.alpha?"rgb("+a+", "+t+", "+e+")":"rgba("+a+", "+t+", "+e+", "+ta(n.alpha)+")"}},ia=function(r){return void 0===r&&(r=.5),function(n){return r<=0?1:r>=1?0:Math.pow(n,Math.log(.5)/Math.log(r))}},ua=function(r,n,a){void 0===n&&(n="rgb"),void 0===a&&(a=!1);var t=n?cr(n).channels:null,e=n?dr(n):pr;return function(o){var i=e(o),u=(t||cr(o.mode).channels).reduce((function(a,t){var e=r(i[t],t,i,n);return void 0===e||isNaN(e)||(a[t]=e),a}),{mode:n});if(!a)return u;var h=pr(o);return h&&h.mode!==u.mode?dr(h.mode)(u):u}},ha=function(r,n,a){return"alpha"!==n?(r||0)*(void 0!==a.alpha?a.alpha:1):r},la=function(r,n,a){return"alpha"!==n&&0!==a.alpha?(r||0)/(void 0!==a.alpha?a.alpha:1):r},ca=function(r,n){return void 0===r&&(r=1),void 0===n&&(n=0),function(a,t){return"alpha"!==t?a*r+n:a}},fa=function(r){return"function"==typeof r},pa=function(r){return r&&"object"==typeof r},da=function(r){return"number"==typeof r},sa=function(r,n,a,t){void 0===n&&(n="rgb");var e=cr(n),o=dr(n),i=[],u=[],h={};r.forEach((function(r){Array.isArray(r)?(i.push(o(r[0])),u.push(r[1])):da(r)||fa(r)?h[u.length]=r:(i.push(o(r)),u.push(void 0))})),function(r){void 0===r[0]&&(r[0]=0),void 0===r[r.length-1]&&(r[r.length-1]=1);for(var n,a,t,e,o=1;o<r.length;){if(void 0===r[o]){for(a=o,t=r[o-1],n=o;void 0===r[n];)n++;for(e=(r[n]-t)/(n-o+1);o<n;)r[o]=t+(o+1-a)*e,o++}else r[o]<r[o-1]&&(r[o]=r[o-1]);o++}}(u);var l=e.channels.reduce((function(r,n){var t;return t=pa(a)&&pa(a[n])&&a[n].fixup?a[n].fixup:pa(e.interpolate[n])&&e.interpolate[n].fixup?e.interpolate[n].fixup:function(r){return r},r[n]=t(i.map((function(r){return r[n]}))),r}),{});if(t){var c=i.map((function(r,a){return e.channels.reduce((function(r,n){return r[n]=l[n][a],r}),{mode:n})}));l=e.channels.reduce((function(r,a){return r[a]=c.map((function(r){var e=t(r[a],a,r,n);return isNaN(e)?void 0:e})),r}),{})}var f=e.channels.reduce((function(r,n){var t;return fa(a)?t=a:pa(a)&&fa(a[n])?t=a[n]:pa(a)&&pa(a[n])&&a[n].use?t=a[n].use:fa(e.interpolate[n])?t=e.interpolate[n]:pa(e.interpolate[n])&&(t=e.interpolate[n].use),r[n]=t(l[n]),r}),{}),p=i.length-1;return function(r){if((r=Math.min(Math.max(0,r),1))<=u[0])return i[0];if(r>u[p])return i[p];for(var a=0;u[a]<r;)a++;var t=u[a-1],o=u[a]-t,l=(r-t)/o,c=h[a]||h[0];void 0!==c&&(da(c)&&(c=ia((c-t)/o)),l=c(l));var d=(a-1+l)/p;return e.channels.reduce((function(r,n){var a=f[n](d);return void 0!==a&&(r[n]=a),r}),{mode:n})}},va=function(r,n){return function(a,t,e){void 0===t&&(t="rgb");var o=n?ua(n,t):void 0,i=sa(a,t,e,r);return o?function(r){return o(i(r))}:i}},ba=va(ha,la),ga=function(r){return(1-Math.cos(r*Math.PI))/2},Ma=function(r,n,a,t,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*r+(4-6*o+3*i)*n+(1+3*e+3*o-3*i)*a+i*t)/6},ma=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return Ma(t>0?r[t-1]:2*r[t]-r[t+1],r[t],r[t+1],t<a-1?r[t+2]:2*r[t+1]-r[t],(n-t/a)*a)}},ya=function(r){return function(n){var a=r.length-1,t=1===n?a-1:Math.floor(n*a);return Ma(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(n-t/a)*a)}},xa=function(r){var n,a=r.length-1,t=new Array(a),e=new Array(a),o=new Array(a);for(t[1]=1/4,e[1]=(6*r[1]-r[0])/4,n=2;n<a;++n)t[n]=1/(4-t[n-1]),e[n]=(6*r[n]-(n==a-1?r[a]:0)-e[n-1])*t[n];for(o[0]=r[0],o[a]=r[a],a-1>0&&(o[a-1]=e[a-1]),n=a-2;n>0;--n)o[n]=e[n]-t[n]*o[n+1];return o},wa=function(r){return ma(xa(r))},ka=function(r){return ya(xa(r))},za=Math.sign,Pa=Math.min,Ia=Math.abs,qa=function(r){for(var n=r.length-1,a=[],t=[],e=[],o=0;o<n;o++)a.push((r[o+1]-r[o])*n),t.push(o>0?.5*(r[o+1]-r[o-1])*n:void 0),e.push(o>0?(za(a[o-1])+za(a[o]))*Pa(Ia(a[o-1]),Ia(a[o]),.5*Ia(t[o])):void 0);return[a,t,e]},ja=function(r,n,a){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(n[i]+n[i+1]-2*a[i])*e*l+(3*a[i]-2*n[i]-n[i+1])*t*h+n[i]*u+r[i]}},Sa=function(r){if(r.length<3)return k(r);var n=r.length-1,a=qa(r),t=a[0],e=a[2];return e[0]=t[0],e[n]=t[n-1],ja(r,e,t)},Ea=function(r){var n=r.length-1,a=qa(r),t=a[0],e=a[1],o=a[2];e[0]=.5*(r[1]-r[n])*n,e[n]=.5*(r[0]-r[n-1])*n;var i=(r[0]-r[n])*n,u=i;return o[0]=(za(i)+za(t[0]))*Pa(Ia(i),Ia(t[0]),.5*Ia(e[0])),o[n]=(za(t[n-1])+za(u))*Pa(Ia(t[n-1]),Ia(u),.5*Ia(e[n])),ja(r,o,t)},Oa=dr("rgb"),Aa=function(r){var n=Oa(r);return void 0!==n&&n.r>=0&&n.r<=1&&n.g>=0&&n.g<=1&&n.b>=0&&n.b<=1},Ca=dr("lch"),Ra=dr("rgb"),Na=function(r){var n=Ra(r);return n.r=Math.max(0,Math.min(n.r,1)),n.g=Math.max(0,Math.min(n.g,1)),n.b=Math.max(0,Math.min(n.b,1)),n},Ha=function(r){return void 0===(r=pr(r))||Aa(r)?r:dr(r.mode)(Na(r))},$a=function(r){if(void 0===(r=pr(r))||Aa(r))return r;var n=dr(r.mode);r=Ca(r);var a=Object.assign({},r,{c:0});if(!Aa(a))return n(Na(r));for(var t=0,e=r.c;e-t>.01;)a.c=t+.5*(e-t),Aa(a)?t=a.c:e=a.c;return n(a)},Da={normal:function(r,n){return n},multiply:function(r,n){return r*n},screen:function(r,n){return r+n-r*n},"hard-light":function(r,n){return n<.5?2*r*n:2*n*(1-r)-1},overlay:function(r,n){return r<.5?2*n*r:2*r*(1-n)-1},darken:function(r,n){return Math.min(r,n)},lighten:function(r,n){return Math.max(r,n)},"color-dodge":function(r,n){return 0===r?0:1===n?1:Math.min(1,r/(1-n))},"color-burn":function(r,n){return 1===r?1:0===n?0:1-Math.min(1,(1-r)/n)},"soft-light":function(r,n){return n<.5?r-(1-2*n)*r*(1-r):r+(2*n-1)*((r<.25?((16*r-12)*r+4)*r:Math.sqrt(r))-r)},difference:function(r,n){return Math.abs(r-n)},exclusion:function(r,n){return r+n-2*r*n}};function La(r){var n=dr("lrgb")(r);return.2126*n.r+.7152*n.g+.0722*n.b}var Ta=dr("rgb"),Ba=[[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]],Fa=[[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]],Ga=[[1,0,-0,0,1,0,-0,-0,1],[.92667,.092514,-.019184,.021191,.964503,.014306,.008437,.054813,.93675],[.89572,.13333,-.02905,.029997,.9454,.024603,.013027,.104707,.882266],[.905871,.127791,-.033662,.026856,.941251,.031893,.01341,.148296,.838294],[.948035,.08949,-.037526,.014364,.946792,.038844,.010853,.193991,.795156],[1.017277,.027029,-.044306,-.006113,.958479,.047634,.006379,.248708,.744913],[1.104996,-.046633,-.058363,-.032137,.971635,.060503,.001336,.317922,.680742],[1.193214,-.109812,-.083402,-.058496,.97941,.079086,-.002346,.403492,.598854],[1.257728,-.139648,-.118081,-.078003,.975409,.102594,-.003316,.501214,.502102],[1.278864,-.125333,-.153531,-.084748,.957674,.127074,-989e-6,.601151,.399838],[1.255528,-.076749,-.178779,-.078411,.930809,.147602,.004733,.691367,.3039]],Wa=function(r,n){var a=Math.max(0,Math.min(1,n)),t=Math.round(a/.1),e=Math.round(a%.1),o=r[t];if(e>0&&t<r.length-1){var i=r[t+1];o=o.map((function(r,n){return y(o[n],i[n],e)}))}return function(r){var n=pr(r);if(void 0!==n){var a=Ta(n),t=a.r,e=a.g,i=a.b,u={mode:"rgb",r:o[0]*t+o[1]*e+o[2]*i,g:o[3]*t+o[4]*e+o[5]*i,b:o[6]*t+o[7]*e+o[8]*i};return void 0!==n.alpha&&(u.alpha=n.alpha),dr(n.mode)(u)}}},_a=function(r){return void 0===r&&(r=1),Wa(Ba,r)},Ka=function(r){return void 0===r&&(r=1),Wa(Fa,r)},Ja=function(r){return void 0===r&&(r=1),Wa(Ga,r)},Qa=function(r){return Math.max(r,0)},Ua=function(r){return Math.max(Math.min(r,1),0)},Va=function(r,n,a){void 0===a&&(a=!1);var t=dr(n),e=cr(n).channels;return function(o){var i=t(o);if(i){for(var u,h={mode:n},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(!a)return h;var f=pr(o);return f&&h.mode!==f.mode?dr(f.mode)(h):h}}};lr($),lr(An),lr(Gn),lr(Wn),lr(Pr),lr(xr),lr(zr),lr(qr),lr($r),lr(Tr),lr(Xr),lr(un),lr(cn),lr(fn),lr(Pn),lr(E),lr(wn),lr(T),lr(J),lr(rr),lr(P),lr(Kn),lr(_n),lr(Jn),lr(Yn),lr(Zn);var Xa=dr("a98"),Ya=dr("cubehelix"),Za=dr("dlab"),rt=dr("dlch"),nt=dr("hsi"),at=dr("hsl"),tt=dr("hsv"),et=dr("hwb"),ot=dr("jab"),it=dr("jch"),ut=dr("lab"),ht=dr("lab65"),lt=dr("lch"),ct=dr("lch65"),ft=dr("lchuv"),pt=dr("lrgb"),dt=dr("luv"),st=dr("p3"),vt=dr("prophoto"),bt=dr("rec2020"),gt=dr("rgb"),Mt=dr("xyz"),mt=dr("xyz65"),yt=dr("yiq"),xt=dr("oklab"),wt=dr("oklch");r.a98=Xa,r.average=function(r,n,a){void 0===n&&(n="rgb");var t=cr(n),e=r.map(dr(n));return t.channels.reduce((function(r,n){var o,i=e.map((function(r){return r[n]})).filter((function(r){return void 0!==r}));i.length&&(o=yr(a)?a:a&&yr(a[n])?a[n]:t.average&&yr(t.average[n])?t.average[n]:mr,r[n]=o(i,n));return r}),{mode:n})},r.averageAngle=Mr,r.averageNumber=mr,r.blend=function(r,n,a){void 0===n&&(n="normal"),void 0===a&&(a="rgb");var t="function"==typeof n?n:Da[n],e=dr(a),o=cr(a).channels;return r.map((function(r){var n=e(r);return void 0===n.alpha&&(n.alpha=1),n})).reduce((function(r,n){if(void 0===r)return n;var e=n.alpha+r.alpha*(1-n.alpha);return o.reduce((function(a,o){return"alpha"!==o&&(0===e?a[o]=0:(a[o]=n.alpha*(1-r.alpha)*n[o]+n.alpha*r.alpha*t(r[o],n[o])+(1-n.alpha)*r.alpha*r[o],a[o]=Math.max(0,Math.min(1,a[o]/e)))),a}),{mode:a,alpha:e})}))},r.clamp=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return Ha;case"lch":return $a}},r.clampChroma=$a,r.clampRgb=Ha,r.colorsNamed=a,r.converter=dr,r.cubehelix=Ya,r.deficiencyDeuter=Ka,r.deficiencyProt=_a,r.deficiencyTrit=Ja,r.defineMode=lr,r.differenceCie76=function(){return gr("lab65")},r.differenceCie94=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=.045),void 0===a&&(a=.015);var t=dr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,d=u.a,s=u.b,v=Math.sqrt(d*d+s*s),b=Math.pow(h-p,2),g=Math.pow(f-v,2),M=Math.pow(l-d,2)+Math.pow(c-s,2)-g;return Math.sqrt(b/Math.pow(r,2)+g/Math.pow(1+n*f,2)+M/Math.pow(1+a*f,2))}},r.differenceCiede2000=function(r,n,a){void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=1);var t=dr("lab65");return function(e,o){var i=t(e),u=t(o),h=i.l,l=i.a,c=i.b,f=Math.sqrt(l*l+c*c),p=u.l,d=u.a,s=u.b,v=(f+Math.sqrt(d*d+s*s))/2,b=.5*(1-Math.sqrt(Math.pow(v,7)/(Math.pow(v,7)+Math.pow(25,7)))),g=l*(1+b),M=d*(1+b),m=Math.sqrt(g*g+c*c),y=Math.sqrt(M*M+s*s),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(s)===0?0:Math.atan2(s,M);w+=2*(w<0)*Math.PI;var k=p-h,z=y-m,P=m*y==0?0:w-x;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var I,q=2*Math.sqrt(m*y)*Math.sin(P/2),j=(h+p)/2,S=(m+y)/2;m*y==0?I=x+w:(I=(x+w)/2,I-=(Math.abs(x-w)>Math.PI)*Math.PI,I+=2*(I<0)*Math.PI);var E=Math.pow(j-50,2),O=1-.17*Math.cos(I-Math.PI/6)+.24*Math.cos(2*I)+.32*Math.cos(3*I+Math.PI/30)-.2*Math.cos(4*I-63*Math.PI/180),A=1+.015*E/Math.sqrt(20+E),C=1+.045*S,R=1+.015*S*O,N=30*Math.PI/180*Math.exp(-1*Math.pow((180/Math.PI*I-275)/25,2)),H=2*Math.sqrt(Math.pow(S,7)/(Math.pow(S,7)+Math.pow(25,7))),$=-1*Math.sin(2*N)*H;return Math.sqrt(Math.pow(k/(r*A),2)+Math.pow(z/(n*C),2)+Math.pow(q/(a*R),2)+$*z/(n*C)*q/(a*R))}},r.differenceCmc=function(r,n){void 0===r&&(r=1),void 0===n&&(n=1);var a=dr("lab65");return function(t,e){var o=a(t),i=o.l,u=o.a,h=o.b,l=Math.sqrt(u*u+h*h),c=Math.atan2(h,u);c+=2*Math.PI*(c<0);var f=a(e),p=f.l,d=f.a,s=f.b,v=Math.sqrt(d*d+s*s),b=Math.pow(i-p,2),g=Math.pow(l-v,2),M=Math.pow(u-d,2)+Math.pow(h-s,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(n*x,2)+M/Math.pow(w,2))}},r.differenceDin99o=function(){return gr("dlab")},r.differenceEuclidean=gr,r.differenceHueChroma=br,r.differenceHueNaive=vr,r.differenceHueSaturation=sr,r.differenceKotsarenkoRamos=function(){return gr("yiq",[.5053,.299,.1957])},r.displayable=Aa,r.dlab=Za,r.dlch=rt,r.easingGamma=x,r.easingInOutSine=ga,r.easingMidpoint=ia,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,n){void 0===r&&(r=1),void 0===n&&(n="rgb");var a=Qa(r);return ua(ca(a),n,!0)},r.filterContrast=function(r,n){void 0===r&&(r=1),void 0===n&&(n="rgb");var a=Qa(r);return ua(ca(a,(1-a)/2),n,!0)},r.filterDeficiencyDeuter=Ka,r.filterDeficiencyProt=_a,r.filterDeficiencyTrit=Ja,r.filterGrayscale=function(r,n){return void 0===r&&(r=1),void 0===n&&(n="rgb"),Va([.2126+.7874*(a=1-Ua(r)),.7152-.7152*a,.0722-.0722*a,0,.2126-.2126*a,.7152+.2848*a,.0722-.0722*a,0,.2126-.2126*a,.7152-.7152*a,.0722+.9278*a,0,0,0,0,1],n,!0);var a},r.filterHueRotate=function(r,n){return void 0===r&&(r=0),void 0===n&&(n="rgb"),Va(function(r){var n=Math.PI*r/180,a=Math.cos(n),t=Math.sin(n);return[.213+.787*a-.213*t,.715-.715*a-.715*t,.072-.072*a+.928*t,0,.213-.213*a+.143*t,.715+.285*a+.14*t,.072-.072*a-.283*t,0,.213-.213*a-.787*t,.715-.715*a+.715*t,.072+.928*a+.072*t,0,0,0,0,1]}(r),n,!0)},r.filterInvert=function(r,n){void 0===r&&(r=1),void 0===n&&(n="rgb");var a=Ua(r);return ua((function(r,n){return"alpha"===n?r:function(r,n,a){return void 0===r||void 0===n?void 0:r+a*(n-r)}(a,1-a,r)}),n,!0)},r.filterSaturate=function(r,n){return void 0===r&&(r=1),void 0===n&&(n="rgb"),Va(function(r){var n=Qa(r);return[.213+.787*n,.715-.715*n,.072-.072*n,0,.213-.213*n,.715+.285*n,.072-.072*n,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,1]}(r),n,!0)},r.filterSepia=function(r,n){return void 0===r&&(r=1),void 0===n&&(n="rgb"),Va([.393+.607*(a=1-Ua(r)),.769-.769*a,.189-.189*a,0,.349-.349*a,.686+.314*a,.168-.168*a,0,.272-.272*a,.534-.534*a,.131+.869*a,0,0,0,0,1],n,!0);var a},r.fixupAlpha=z,r.fixupHueDecreasing=function(r){return tr(r,(function(r){return r<=0?r:r-360}))},r.fixupHueIncreasing=function(r){return tr(r,(function(r){return r>=0?r:r+360}))},r.fixupHueLonger=function(r){return tr(r,(function(r){return Math.abs(r)>=180||0===r?r:r-360*Math.sign(r)}))},r.fixupHueShorter=er,r.formatHex=ea,r.formatHex8=function(r){var n=aa(r);if(void 0!==n){var a=na(void 0!==n.alpha?n.alpha:1);return ea(n)+(256|a).toString(16).slice(1)}},r.formatRgb=oa,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return oa;case"hex":return ea}},r.getModeDefinition=cr,r.hsi=nt,r.hsl=at,r.hsv=tt,r.hwb=et,r.interpolate=function(r,n,a){return void 0===n&&(n="rgb"),sa(r,n,a)},r.interpolateAlpha=z,r.interpolateCosine=function(r,n){return void 0===n&&(n=1),function(a){var t=x(n),e=w((function(r,n,a){return y(r,n,ga(a))}))((r||function(r){return r})(a));return function(r){return e(t(r))}}},r.interpolateHue=er,r.interpolateLinear=function(r,n){return void 0===n&&(n=1),function(a){var t=x(n);return function(n){return k((r||function(r){return r})(a))(t(n))}}},r.interpolateSplineBasis=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"default"===n?function(n){return ma((r||function(r){return r})(t))(e(n))}:"closed"===n?function(n){return ya((r||function(r){return r})(t))(e(n))}:void 0}},r.interpolateSplineMonotone=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"closed"===n?function(n){return Ea((r||function(r){return r})(t))(e(n))}:"default"===n?function(n){return Sa((r||function(r){return r})(t))(e(n))}:void 0}},r.interpolateSplineNatural=function(r,n,a){return void 0===n&&(n="default"),void 0===a&&(a=1),function(t){var e=x(a);return"default"===n?function(n){return wa((r||function(r){return r})(t))(e(n))}:"closed"===n?function(n){return ka((r||function(r){return r})(t))(e(n))}:void 0}},r.interpolateWith=va,r.interpolateWithPremultipliedAlpha=ba,r.interpolatorLinear=k,r.interpolatorPiecewise=w,r.interpolatorSplineBasis=ma,r.interpolatorSplineBasisClosed=ya,r.interpolatorSplineMonotone=Sa,r.interpolatorSplineMonotone2=function(r){if(r.length<3)return k(r);var n=r.length-1,a=qa(r),t=a[0],e=a[1],o=a[2];return e[0]=(2*r[1]-1.5*r[0]-.5*r[2])*n,e[n]=(1.5*r[n]-2*r[n-1]+.5*r[n-2])*n,o[0]=e[0]*t[0]<=0?0:Ia(e[0])>2*Ia(t[0])?2*t[0]:e[0],o[n]=e[n]*t[n-1]<=0?0:Ia(e[n])>2*Ia(t[n-1])?2*t[n-1]:e[n],ja(r,o,t)},r.interpolatorSplineMonotoneClosed=Ea,r.interpolatorSplineNatural=wa,r.interpolatorSplineNaturalClosed=ka,r.jab=ot,r.jch=it,r.lab=ut,r.lab65=ht,r.lch=lt,r.lch65=ct,r.lchuv=ft,r.lerp=y,r.lrgb=pt,r.luv=dt,r.mapAlphaDivide=la,r.mapAlphaMultiply=ha,r.mapTransferGamma=function(r,n,a){return void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=0),function(t,e){return"alpha"!==e?r*Math.pow(t,n)+a:t}},r.mapTransferLinear=ca,r.mapper=ua,r.nearest=function(r,n,a){void 0===n&&(n=gr()),void 0===a&&(a=function(r){return r});var t=r.map((function(r,n){return{color:a(r),i:n}}));return function(a,e,o){return void 0===e&&(e=1),void 0===o&&(o=1/0),isFinite(e)&&(e=Math.max(1,Math.min(e,t.length-1))),t.forEach((function(r){r.d=n(a,r.color)})),t.sort((function(r,n){return r.d-n.d})).slice(0,e).filter((function(r){return r.d<o})).map((function(n){return r[n.i]}))}},r.oklab=xt,r.oklch=wt,r.p3=st,r.parse=fr,r.prophoto=vt,r.random=function(r,n){void 0===r&&(r="rgb"),void 0===n&&(n={});var a=cr(r),t=function(r){return Object.keys(r).reduce((function(n,a){var t=r[a];return n[a]=Array.isArray(t)?t:[t,t],n}),{})}(n);return a.channels.reduce((function(r,n){return(t.alpha||"alpha"!==n)&&(r[n]=function(r){var n=r[0],a=r[1];return n+Math.random()*(a-n)}(t[n]||a.ranges[n])),r}),{mode:r})},r.rec2020=bt,r.rgb=gt,r.round=ra,r.samples=function(r,n){void 0===r&&(r=2),void 0===n&&(n=1);var a=x(n);if(r<2)return r<1?[]:[a(.5)];for(var t=[],e=0;e<r;e++)t.push(a(e/(r-1)));return t},r.wcagContrast=function(r,n){var a=La(r),t=La(n);return(Math.max(a,t)+.05)/(Math.min(a,t)+.05)},r.wcagLuminance=La,r.xyz=Mt,r.xyz65=mt,r.yiq=yt,Object.defineProperty(r,"__esModule",{value:!0})}));
{
"name": "culori",
"version": "0.18.1",
"version": "0.18.2",
"main": "build/culori.umd.js",

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

"eslint": "^7.4.0",
"eslint-plugin-import": "^2.22.1",
"esm": "^3.2.25",

@@ -56,3 +57,3 @@ "gh-pages": "^3.1.0",

"benchmark": "node benchmark/index.js",
"prepublishOnly": "npm run build && npm run test",
"prepublishOnly": "npm run lint && npm run build && npm run test",
"coverage:report": "nyc report --reporter=lcov",

@@ -63,3 +64,3 @@ "coverage:test": "nyc --produce-source-map tape -r esm 'test/*.js' | tap-spec",

"docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles",
"lint": "eslint {src,test}/**/*.js"
"lint": "eslint '{src,test}/**/*.js'"
},

@@ -66,0 +67,0 @@ "husky": {

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