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.17.0 to 0.18.0

2

build/culori.umd.js

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

!function(r,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((r=r||self).culori={})}(this,(function(r){"use strict";function a(r,a){if("number"==typeof r)return 3===a?{mode:"rgb",r:(r>>8&15|r>>4&240)/255,g:(r>>4&15|240&r)/255,b:(15&r|r<<4&240)/255}:4===a?{mode:"rgb",r:(r>>12&15|r>>8&240)/255,g:(r>>8&15|r>>4&240)/255,b:(r>>4&15|240&r)/255,alpha:(15&r|r<<4&240)/255}:6===a?{mode:"rgb",r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}:8===a?{mode:"rgb",r:(r>>24&255)/255,g:(r>>16&255)/255,b:(r>>8&255)/255,alpha:(255&r)/255}:void 0}var n={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var t=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),e=t+"%",o=t+"%?",i="(?:"+t+"%|"+t+")",u="(?:"+t+"(deg|grad|rad|turn)|"+t+")",h="\\s*,\\s*",l="\\s+",c=new RegExp("^rgba?\\(\\s*"+t+h+t+h+t+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),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*)?\\)$"),v=new RegExp("^hsla?\\(\\s*"+u+h+e+h+e+"\\s*(?:,\\s*"+i+"\\s*)?\\)$"),s=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)}}},z=w(y),k=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:z,g:z,b:z,alpha:{use:z,fixup:k}}},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 B=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:[]}),T=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:T(1.3457989731028281*a-.25558010007997534*n-.05110628506753401*t),g:T(-.5446224939028347*a+1.5082327413132781*n+.02053603239147973*t),b:T(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}},vr=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},sr=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(v)||r.match(s);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:z,fixup:er},s:z,l:z,alpha:{use:z,fixup:k}},difference:{h:vr},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 zr(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 kr={mode:"hsv",output:{rgb:wr},input:{rgb:zr},channels:["h","s","v","alpha"],ranges:{h:[0,360]},interpolate:{h:{use:z,fixup:er},s:z,v:z,alpha:{use:z,fixup:k}},difference:{h:vr},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:z,fixup:er},s:z,i:z,alpha:{use:z,fixup:k}},difference:{h:vr},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=zr(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:z,fixup:er},w:z,b:z,alpha:{use:z,fixup:k}},difference:{h:sr},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:z,a:z,b:z,alpha:{use:z,fixup:k}}};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:z,fixup:er},c:z,j:z,alpha:{use:z,fixup:k}},difference:{h:br},average:{h:Mr}},Br=.96422,Tr=.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)*Br,y:1*Wr(o),z:Wr(i)*Tr};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/Br),i=Jr(n/1),u={mode:"lab",l:116*i-16,a:500*(o-i),b:200*(i-Jr(t/Tr))};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:z,a:z,b:z,alpha:{use:z,fixup:k}}},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:z,fixup:er},c:z,l:z,alpha:{use:z,fixup:k}},difference:{h:br},average:{h:Mr}},la=Object.assign({},ha,{mode:"lch65",alias:["lch-d65"],output:{lab65:ua,rgb:function(r){return aa(ua(r,"lab65"))}},input:{rgb:function(r){return ia(ea(r),"lch65")},lab65:ia},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(Br,1,Tr),da=fa(Br,1,Tr);function va(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 sa(r){return va(K(r))}var ba,ga=4*(ba=Br)/(ba+15*1+3*Tr),Ma=function(r,a,n){return 9*a/(r+15*a+3*n)}(Br,1,Tr);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:va,rgb:sa},channels:["l","u","v","alpha"],ranges:{l:[0,100],u:[-84.86,174.87],v:[-125.744,87.165]},interpolate:{l:z,u:z,v:z,alpha:{use:z,fixup:k}}};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 za(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 ka={mode:"lchuv",output:{luv:za,rgb:function(r){return ya(za(r))}},input:{rgb:function(r){return wa(sa(r))},luv:wa},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,131.008],h:[0,360]},interpolate:{h:{use:z,fixup:er},c:z,l:z,alpha:{use:z,fixup:k}},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:z,fixup:er},s:z,l:z,alpha:{use:z,fixup:k}},difference:{h:vr},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 Ba(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 Ta(r){return Ba(La(r))}var Fa={mode:"dlab",output:{lab65:Da,rgb:function(r){return aa(Da(r))}},input:{lab65:Ta,rgb:function(r){return Ta(ea(r))}},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.5],b:[-40.47,44.344]},interpolate:{l:z,a:z,b:z,alpha:{use:z,fixup:k}}},Ga={mode:"dlch",output:{lab65:$a,dlab:Ba,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:z,c:z,h:{use:z,fixup:er},alpha:{use:z,fixup:k}},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:z,y:z,z:z,alpha:{use:z,fixup:k}}};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:z,y:z,z:z,alpha:{use:z,fixup:k}}};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:z,i:z,q:z,alpha:{use:z,fixup:k}}};function Ja(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 Qa(r){return Math.round(255*Math.max(0,Math.min(r,1)))}var Ua=dr("rgb"),Va=Ja(2),Xa=function(r){var a=Ua(r);if(void 0!==a)return"#"+(1<<24|Qa(a.r)<<16|Qa(a.g)<<8|Qa(a.b)).toString(16).slice(1)},Ya=function(r){var a=Ua(r);if(void 0!==a){var n=Qa(a.r),t=Qa(a.g),e=Qa(a.b);return void 0===a.alpha||1===a.alpha?"rgb("+n+", "+t+", "+e+")":"rgba("+n+", "+t+", "+e+", "+Va(a.alpha)+")"}};function Za(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 rn=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}},an=function(r,a,n){return"alpha"!==a?(r||0)*(void 0!==n.alpha?n.alpha:1):r},nn=function(r,a,n){return"alpha"!==a&&0!==n.alpha?(r||0)/(void 0!==n.alpha?n.alpha:1):r},tn=function(r,a){return void 0===r&&(r=1),void 0===a&&(a=0),function(n,t){return"alpha"!==t?n*r+a:n}},en=function(r){return"function"==typeof r},on=function(r){return r&&"object"==typeof r},un=function(r){return"number"==typeof r},hn=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])):un(r)||en(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=on(n)&&on(n[a])&&n[a].fixup?n[a].fixup:on(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 en(n)?t=n:on(n)&&en(n[a])?t=n[a]:on(n)&&on(n[a])&&n[a].use?t=n[a].use:en(e.interpolate[a])?t=e.interpolate[a]:on(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&&(un(c)&&(c=Za((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})}},ln=function(r,a){return function(n,t,e){void 0===t&&(t="rgb");var o=a?rn(a,t):void 0,i=hn(n,t,e,r);return o?function(r){return o(i(r))}:i}},cn=ln(an,nn);function fn(r){return(1-Math.cos(r*Math.PI))/2}var pn=function(r,a,n,t,e){var o=e*e,i=o*e;return((1-3*e+3*o-i)*r+(4-6*o+3*i)*a+(1+3*e+3*o-3*i)*n+i*t)/6},dn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return pn(t>0?r[t-1]:2*r[t]-r[t+1],r[t],r[t+1],t<n-1?r[t+2]:2*r[t+1]-r[t],(a-t/n)*n)}},vn=function(r){return function(a){var n=r.length-1,t=1===a?n-1:Math.floor(a*n);return pn(r[(t-1+r.length)%r.length],r[t],r[(t+1)%r.length],r[(t+2)%r.length],(a-t/n)*n)}},sn=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},bn=function(r){return dn(sn(r))},gn=function(r){return vn(sn(r))},Mn=Math.sign,mn=Math.min,yn=Math.abs,xn=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?(Mn(n[o-1])+Mn(n[o]))*mn(yn(n[o-1]),yn(n[o]),.5*yn(t[o])):void 0);return[n,t,e]},wn=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]}},zn=function(r){if(r.length<3)return z(r);var a=r.length-1,n=xn(r),t=n[0],e=n[2];return e[0]=t[0],e[a]=t[a-1],wn(r,e,t)},kn=function(r){var a=r.length-1,n=xn(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]=(Mn(i)+Mn(t[0]))*mn(yn(i),yn(t[0]),.5*yn(e[0])),o[a]=(Mn(t[a-1])+Mn(u))*mn(yn(t[a-1]),yn(u),.5*yn(e[a])),wn(r,o,t)};var Pn=dr("rgb");function In(r){var a=Pn(r);return void 0!==a&&a.r>=0&&a.r<=1&&a.g>=0&&a.g<=1&&a.b>=0&&a.b<=1}var qn=dr("lch"),jn=dr("rgb"),Sn=function(r){var a=jn(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},En=function(r){return void 0===(r=pr(r))||In(r)?r:dr(r.mode)(Sn(r))},On=function(r){if(void 0===(r=pr(r))||In(r))return r;var a=dr(r.mode);r=qn(r);var n=Object.assign({},r,{c:0});if(!In(n))return a(Sn(r));for(var t=0,e=r.c;e-t>.01;)n.c=t+.5*(e-t),In(n)?t=n.c:e=n.c;return a(n)};var An={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 Cn(r){var a=dr("lrgb")(r);return.2126*a.r+.7152*a.g+.0722*a.b}var Rn=dr("rgb"),Nn=[[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]],Hn=[[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]],$n=[[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]],Dn=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=Rn(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)}}},Ln=function(r){return void 0===r&&(r=1),Dn(Nn,r)},Bn=function(r){return void 0===r&&(r=1),Dn(Hn,r)},Tn=function(r){return void 0===r&&(r=1),Dn($n,r)};var Fn=function(r){return Math.max(r,0)},Gn=function(r){return Math.max(Math.min(r,1),0)},Wn=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(kr),lr(Ir),lr(Hr),lr(Lr),lr(Vr),lr(oa),lr(ha),lr(la),lr(ka),lr(E),lr(xa),lr(B),lr(J),lr(rr),lr(P),lr(_a),lr(Wa),lr(Ka);var _n=dr("a98"),Kn=dr("cubehelix"),Jn=dr("dlab"),Qn=dr("dlch"),Un=dr("hsi"),Vn=dr("hsl"),Xn=dr("hsv"),Yn=dr("hwb"),Zn=dr("jab"),rt=dr("jch"),at=dr("lab"),nt=dr("lab65"),tt=dr("lch"),et=dr("lch65"),ot=dr("lchuv"),it=dr("lrgb"),ut=dr("luv"),ht=dr("p3"),lt=dr("prophoto"),ct=dr("rec2020"),ft=dr("rgb"),pt=dr("xyz"),dt=dr("xyz65"),vt=dr("yiq");r.a98=_n,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:An[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 En;case"lch":return On}},r.clampChroma=On,r.clampRgb=En,r.colorsNamed=n,r.converter=dr,r.cubehelix=Kn,r.deficiencyDeuter=Bn,r.deficiencyProt=Ln,r.deficiencyTrit=Tn,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,v=u.b,s=Math.sqrt(d*d+v*v),b=Math.pow(h-p,2),g=Math.pow(f-s,2),M=Math.pow(l-d,2)+Math.pow(c-v,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,v=u.b,s=(f+Math.sqrt(d*d+v*v))/2,b=.5*(1-Math.sqrt(Math.pow(s,7)/(Math.pow(s,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+v*v),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(v)===0?0:Math.atan2(v,M);w+=2*(w<0)*Math.PI;var z=p-h,k=y-m,P=m*y==0?0:w-x;P-=2*(P>Math.PI)*Math.PI,P+=2*(P<-Math.PI)*Math.PI;var 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(z/(r*A),2)+Math.pow(k/(a*C),2)+Math.pow(q/(n*R),2)+$*k/(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,v=f.b,s=Math.sqrt(d*d+v*v),b=Math.pow(i-p,2),g=Math.pow(l-s,2),M=Math.pow(u-d,2)+Math.pow(h-v,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=sr,r.differenceHueSaturation=vr,r.differenceKotsarenkoRamos=function(){return gr("yiq",[.5053,.299,.1957])},r.displayable=In,r.dlab=Jn,r.dlch=Qn,r.easingGamma=x,r.easingInOutSine=fn,r.easingMidpoint=Za,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=Fn(r);return rn(tn(n),a,!0)},r.filterContrast=function(r,a){void 0===r&&(r=1),void 0===a&&(a="rgb");var n=Fn(r);return rn(tn(n,(1-n)/2),a,!0)},r.filterDeficiencyDeuter=Bn,r.filterDeficiencyProt=Ln,r.filterDeficiencyTrit=Tn,r.filterGrayscale=function(r,a){return void 0===r&&(r=1),void 0===a&&(a="rgb"),Wn([.2126+.7874*(n=1-Gn(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"),Wn(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=Gn(r);return rn((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"),Wn(function(r){var a=Fn(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"),Wn([.393+.607*(n=1-Gn(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=k,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=Xa,r.formatHex8=function(r){var a=Ua(r);if(void 0!==a){var n=Qa(void 0!==a.alpha?a.alpha:1);return Xa(a)+(256|n).toString(16).slice(1)}},r.formatRgb=Ya,r.formatter=function(r){switch(void 0===r&&(r="rgb"),r){case"rgb":return Ya;case"hex":return Xa}},r.getModeDefinition=cr,r.hsi=Un,r.hsl=Vn,r.hsv=Xn,r.hwb=Yn,r.interpolate=function(r,a,n){return void 0===a&&(a="rgb"),hn(r,a,n)},r.interpolateAlpha=k,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,fn(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 z((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 dn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return vn((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 kn((r||function(r){return r})(t))(e(a))}:"default"===a?function(a){return zn((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 bn((r||function(r){return r})(t))(e(a))}:"closed"===a?function(a){return gn((r||function(r){return r})(t))(e(a))}:void 0}},r.interpolateWith=ln,r.interpolateWithPremultipliedAlpha=cn,r.interpolatorLinear=z,r.interpolatorPiecewise=w,r.interpolatorSplineBasis=dn,r.interpolatorSplineBasisClosed=vn,r.interpolatorSplineMonotone=zn,r.interpolatorSplineMonotone2=function(r){if(r.length<3)return z(r);var a=r.length-1,n=xn(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:yn(e[0])>2*yn(t[0])?2*t[0]:e[0],o[a]=e[a]*t[a-1]<=0?0:yn(e[a])>2*yn(t[a-1])?2*t[a-1]:e[a],wn(r,o,t)},r.interpolatorSplineMonotoneClosed=kn,r.interpolatorSplineNatural=bn,r.interpolatorSplineNaturalClosed=gn,r.jab=Zn,r.jch=rt,r.lab=at,r.lab65=nt,r.lch=tt,r.lch65=et,r.lchuv=ot,r.lerp=y,r.lrgb=it,r.luv=ut,r.mapAlphaDivide=nn,r.mapAlphaMultiply=an,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*pow(t,a)+n:t}},r.mapTransferLinear=tn,r.mapper=rn,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.p3=ht,r.parse=fr,r.prophoto=lt,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=ct,r.rgb=ft,r.round=Ja,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=Cn(r),t=Cn(a);return(Math.max(n,t)+.05)/(Math.min(n,t)+.05)},r.wcagLuminance=Cn,r.xyz=pt,r.xyz65=dt,r.yiq=vt,Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((r="undefined"!=typeof globalThis?globalThis:r||self).culori={})}(this,(function(r){"use strict";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*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})}));
{
"name": "culori",
"version": "0.17.0",
"version": "0.18.0",
"main": "build/culori.umd.js",

@@ -53,11 +53,11 @@ "browser": "build/culori.umd.js",

"build": "rollup -c",
"test": "tape -r esm test/*.js | tap-spec",
"test": "tape -r esm 'test/*.js' | tap-spec",
"benchmark": "node benchmark/index.js",
"prepublishOnly": "yarn build && yarn test",
"prepublishOnly": "npm run build && npm run test",
"coverage:report": "nyc report --reporter=lcov",
"coverage:test": "nyc --produce-source-map tape -r esm test/*.js | tap-spec",
"coverage:test": "nyc --produce-source-map tape -r esm 'test/*.js' | tap-spec",
"docs:start": "eleventy --serve",
"docs:build": "rm -rf www && eleventy",
"docs:deploy": "yarn docs:build && gh-pages -d www --dotfiles",
"lint": "yarn eslint {src,test}/**/*.js"
"docs:deploy": "npm run docs:build && gh-pages -d www --dotfiles",
"lint": "eslint {src,test}/**/*.js"
},

@@ -64,0 +64,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