Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

culori

Package Overview
Dependencies
Maintainers
1
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

culori - npm Package Compare versions

Comparing version 0.2.69 to 0.2.70

15

build/culori.js

@@ -382,5 +382,5 @@ (function (global, factory) {

var interpolateCubehelix = (function () {
var startcolor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
var turns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1.5;
var chroma = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var starthue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
var endhue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -240;
var chroma = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;
var gamma = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;

@@ -395,8 +395,9 @@ return function (t) {

var theta = 360 * (startcolor / 3 + turns * t) * degToRad;
var amp = chroma / 2 * t * (1 - t);
var current_hue = starthue + 120 + endhue * t;
var cosh = Math.cos(theta);
var sinh = Math.sin(theta);
var amp = chroma * l * (1 - l);
var cosh = Math.cos(current_hue * degToRad);
var sinh = Math.sin(current_hue * degToRad);
res.r = l + amp * (M[0] * cosh + M[1] * sinh);

@@ -403,0 +404,0 @@ res.g = l + amp * (M[2] * cosh + M[3] * sinh);

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.culori=r()}(this,function(){"use strict";var e={},r={},a=[],t=function(t){e[t.mode]=Object.assign(e[t.mode]||{},t.output),Object.keys(t.input||{}).forEach(function(r){e[r]||(e[r]={}),e[r][t.mode]=t.input[r]}),r[t.mode]=t,(t.parsers||[]).forEach(function(e){return a.push(e)})},n=function(e){return r[e]},o=function(e){for(var r=void 0,t=0,n=a.length;t<n&&void 0===(r=a[t++](e)););return r},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},h=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb";return function(a){return void 0!==(a=function(e,r){return"object"!==(void 0===e?"undefined":i(e))?o(e):void 0===e.mode?l({},e,{mode:r}):e}(a,r))?a.mode===r?a:e[a.mode][r]?e[a.mode][r](a):"rgb"===r?e[a.mode].rgb(a):e.rgb[r](e[a.mode].rgb(a)):void 0}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return function(r){return"number"==typeof r?function(e,r){return Math.round(e*(r=Math.pow(10,r)))/r}(r,e):r}},d=h("rgb"),s=u(2),b=function(e){return Math.round(255*Math.max(0,Math.min(e,1)))},g={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},c=function(e){return(e%=360)<0?e+360:e},p=function(e,r,a){return e+a*(r-e)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return function(r,a){var t=a*(r.length-1),n=Math.floor(t),o=r[n],i=r[n+1];return void 0!==o&&void 0!==i?e(o,i,t-n):void 0===o?i:o}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(a,t){var n=t*(a.length-1),o=Math.floor(n),i=a[o],l=a[o+1],h=n-o;return void 0!==i&&void 0!==l?(i=c(i),l=c(l),r&&Math.abs(l-i)>180?c(e(i,l-360*Math.sign(l-i),h)):e(i,l,h)):void 0===i?l:i}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return function(r,a){var t=a*(r.length-1),n=Math.floor(t),o=r[n],i=r[n+1],l=t-n;if(!(void 0===o&&void 0===i||void 0===o&&0===l||void 0===i&&1===l))return e(void 0===o?1:o,void 0===i?1:i,l)}},y=[-.14861,1.78277,-.29227,-.90649,1.97294,0],w=Math.PI/180,k=function(e,r){if("number"==typeof e)return 3===r?{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|240&e)/255,b:(15&e|e<<4&240)/255}:4===r?{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|240&e)/255,alpha:(15&e|e<<4&240)/255}:6===r?{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}:8===r?{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(255&e)/255}:void 0},M=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),x=M+"%",E="(?:"+M+"%|"+M+")",$="(?:"+M+"(deg|grad|rad|turn)|"+M+")",j="\\s*,\\s*",q="\\s+",R=new RegExp("^rgba?\\(\\s*"+M+j+M+j+M+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),O=new RegExp("^rgba?\\(\\s*"+x+j+x+j+x+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),z=new RegExp("^rgba?\\(\\s*"+M+q+M+q+M+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),I=new RegExp("^rgba?\\(\\s*"+x+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),P=new RegExp("^hsla?\\(\\s*"+$+j+x+j+x+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),S=new RegExp("^hsla?\\(\\s*"+$+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),C=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,L=new RegExp("^hwb\\(\\s*"+$+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),A=new RegExp("^lab\\(\\s*"+M+q+M+q+M+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),D=new RegExp("^lch\\(\\s*"+M+q+M+q+$+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),H=new RegExp("^gray\\(\\s*"+M+"()()\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),N={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(e){var r;return(r=e.match(C))?k(parseInt(r[1],16),r[1].length):void 0},function(e){var r=void 0,a=void 0;if(r=e.match(R)||e.match(z))a={mode:"rgb",r:r[1]/255,g:r[2]/255,b:r[3]/255};else{if(!(r=e.match(O)||e.match(I)))return;a={mode:"rgb",r:r[1]/100,g:r[2]/100,b:r[3]/100}}return void 0!==r[4]?a.alpha=r[4]/100:void 0!==r[5]&&(a.alpha=+r[5]),a},function(e){return"string"==typeof e&&k(g[e.toLowerCase()],6)||void 0},function(e){return"transparent"===e?k(0,8):void 0}],interpolate:{r:v(),g:v(),b:v(),alpha:m()}},B=function(e){return e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},F=function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o={mode:"lrgb",r:B(r),g:B(a),b:B(t)};return void 0!==n&&(o.alpha=n),o},G=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e},J=function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o={mode:"rgb",r:G(r),g:G(a),b:G(t)};return void 0!==n&&(o.alpha=n),o},K={mode:"lrgb",output:{rgb:J},input:{rgb:F},channels:["r","g","b","alpha"],interpolate:{r:v(),g:v(),b:v(),alpha:m()}};var Q=function(e,r){switch(r){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return 360*e}},T={mode:"hsl",output:{rgb:function(e){var r=e.h,a=e.s,t=e.l,n=e.alpha;r=c(r);var o=t+a*(t<.5?t:1-t),i=o-2*(o-t)*Math.abs(r/60%2-1),l=void 0;switch(Math.floor(r/60)){case 0:l={r:o,g:i,b:2*t-o};break;case 1:l={r:i,g:o,b:2*t-o};break;case 2:l={r:2*t-o,g:o,b:i};break;case 3:l={r:2*t-o,g:i,b:o};break;case 4:l={r:i,g:2*t-o,b:o};break;case 5:l={r:o,g:2*t-o,b:i};break;default:l={r:2*t-o,g:2*t-o,b:2*t-o}}return l.mode="rgb",void 0!==n&&(l.alpha=n),l}},input:{rgb:function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}},channels:["h","s","l","alpha"],parsers:[function(e){if("string"==typeof e){var r=e.match(P)||e.match(S);if(r){var a={mode:"hsl",h:void 0===r[3]?Q(r[1],r[2]):+r[3],s:Math.min(Math.max(0,r[4]/100),1),l:Math.min(Math.max(0,r[5]/100),1)};return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=r[7]/255),a}}}],interpolate:{h:f(),s:v(),l:v(),alpha:m()}};function U(e){var r=e.h,a=e.s,t=e.v,n=e.alpha;r=c(r);var o=Math.abs(r/60%2-1),i=void 0;switch(Math.floor(r/60)){case 0:i={r:t,g:t*(1-a*o),b:t*(1-a)};break;case 1:i={r:t*(1-a*o),g:t,b:t*(1-a)};break;case 2:i={r:t*(1-a),g:t,b:t*(1-a*o)};break;case 3:i={r:t*(1-a),g:t*(1-a*o),b:t};break;case 4:i={r:t*(1-a*o),g:t*(1-a),b:t};break;case 5:i={r:t,g:t*(1-a),b:t*(1-a*o)};break;default:i={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return i.mode="rgb",void 0!==n&&(i.alpha=n),i}function V(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}var W={mode:"hsv",output:{rgb:U},input:{rgb:V},channels:["h","s","v","alpha"],interpolate:{h:f(),s:v(),v:v(),alpha:m()}};var X={mode:"hsi",output:{rgb:function(e){var r=e.h,a=e.s,t=e.i,n=e.alpha;r=c(r);var o=Math.abs(r/60%2-1),i=void 0;switch(Math.floor(r/60)){case 0:i={r:t*(1+a*(3/(2-o)-1)),g:t*(1+a*(3*(1-o)/(2-o)-1)),b:t*(1-a)};break;case 1:i={r:t*(1+a*(3*(1-o)/(2-o)-1)),g:t*(1+a*(3/(2-o)-1)),b:t*(1-a)};break;case 2:i={r:t*(1-a),g:t*(1+a*(3/(2-o)-1)),b:t*(1+a*(3*(1-o)/(2-o)-1))};break;case 3:i={r:t*(1-a),g:t*(1+a*(3*(1-o)/(2-o)-1)),b:t*(1+a*(3/(2-o)-1))};break;case 4:i={r:t*(1+a*(3*(1-o)/(2-o)-1)),g:t*(1-a),b:t*(1+a*(3/(2-o)-1))};break;case 5:i={r:t*(1+a*(3/(2-o)-1)),g:t*(1-a),b:t*(1+a*(3*(1-o)/(2-o)-1))};break;default:i={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return i.mode="rgb",void 0!==n&&(i.alpha=n),i}},input:{rgb:function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsi",s:r+a+t===0?0:1-3*i/(r+a+t),i:(r+a+t)/3};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}},channels:["h","s","i","alpha"],interpolate:{h:f(),s:v(),i:v(),alpha:m()}};var Y={mode:"hwb",output:{rgb:function(e){var r=e.h,a=e.w,t=e.b,n=e.alpha;if(a+t>1){var o=a+t;a/=o,t/=o}return U({h:r,s:1===t?1:1-a/(1-t),v:1-t,alpha:n})}},input:{rgb:function(e){var r=V(e);if(void 0!==r){var a={mode:"hwb",w:(1-r.s)*r.v,b:1-r.v};return void 0!==r.h&&(a.h=r.h),void 0!==r.alpha&&(a.alpha=r.alpha),a}}},channels:["h","w","b","alpha"],parsers:[function(e){if("string"==typeof e){var r=e.match(L);if(r){var a={mode:"hwb",h:void 0===r[3]?Q(r[1],r[2]):+r[3],w:r[4]/100,b:r[5]/100};if(a.w+a.b>1){var t=a.w+a.b;a.w/=t,a.b/=t}return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=r[7]/255),a}}}],interpolate:{h:f(),w:v(),b:v(),alpha:m()}},Z=Math.pow(29,3)/Math.pow(3,3),_=Math.pow(6,3)/Math.pow(29,3),ee=function(e){return Math.pow(e,3)>_?Math.pow(e,3):(116*e-16)/Z},re=function(e){var r,a,t,n,o,i=function(e){var r=e.x,a=e.y,t=e.z;return J({r:3.1338561*r-1.6168667*a-.4906146*t,g:-.9787684*r+1.9161415*a+.033454*t,b:.0719453*r-.2289914*a+1.4052427*t})}((a=(r=e).l,t=r.a,o=(n=(a+16)/116)-r.b/200,{x:.96422*ee(t/500+n),y:1*ee(n),z:.82521*ee(o)}));return i.mode="rgb",void 0!==e.alpha&&(i.alpha=e.alpha),i},ae=function(e){return e>_?Math.cbrt(e):(Z*e+16)/116},te=function(e){var r,a,t,n,o,i,l=(r=function(e){var r=F(e),a=r.r,t=r.g,n=r.b;return{x:.4360747*a+.3850649*t+.1430804*n,y:.2225045*a+.7168786*t+.0606169*n,z:.0139322*a+.0971045*t+.7141733*n}}(e),a=r.x,t=r.y,n=r.z,o=ae(a/.96422),{mode:"lab",l:116*(i=ae(t/1))-16,a:500*(o-i),b:200*(i-ae(n/.82521))});return e.r===e.b===e.g&&(l.a=l.b=0),void 0!==e.alpha&&(l.alpha=e.alpha),l},ne={mode:"lab",output:{rgb:re},input:{rgb:te},channels:["l","a","b","alpha"],parsers:[function(e){var r=void 0,a=void 0;if(r=e.match(A))a={mode:"lab",l:+r[1],a:+r[2],b:+r[3]};else{if(!(r=e.match(H)))return;a={mode:"lab",l:+r[1],a:0,b:0}}return void 0!==r[4]?a.alpha=r[4]/100:void 0!==r[5]&&(a.alpha=+r[5]),a}],interpolate:{l:v(),a:v(),b:v(),alpha:m()}},oe=function(e){var r=e.l,a=e.a,t=e.b,n=e.alpha,o=Math.sqrt(a*a+t*t),i={mode:"lch",l:r,c:o};return o&&(i.h=c(180*Math.atan2(t,a)/Math.PI)),void 0!==n&&(i.alpha=n),i},ie=function(e){var r=e.l,a=e.c,t=e.h,n=e.alpha,o={mode:"lab",l:r,a:0===a?0:a*Math.cos(t/180*Math.PI),b:0===a?0:a*Math.sin(t/180*Math.PI)};return void 0!==n&&(o.alpha=n),o},le={mode:"lch",output:{lab:ie,rgb:function(e){return re(ie(e))}},input:{rgb:function(e){return oe(te(e))},lch:oe},channels:["l","c","h","alpha"],parsers:[function(e){var r=e.match(D);if(r){var a={mode:"lch",l:+r[1],c:Math.max(0,+r[2]),h:void 0===r[5]?Q(r[3],r[4]):+r[5]};return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=+r[7]),a}}],interpolate:{h:f(),c:v(),l:v(),alpha:m()}};t(N),t(K),t(T),t(W),t(X),t(Y),t(ne),t(le),t({mode:"cubehelix",channels:["l","s","r","c"],input:{rgb:function(){}},output:{rgb:function(){}}});var he=h("rgb"),ue=h("lrgb"),de=h("hsl"),se=h("hsv"),be=h("hsi"),ge=h("hwb"),ce=h("lab"),pe=h("lch"),ve=h("cubehelix"),fe=he,me=Object.freeze({hsl:de,hsv:se,hsi:be,hwb:ge,rgb:he,lab:ce,lch:pe,lrgb:ue,cubehelix:ve,formatter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb";return function(r){var a=d(r);return a.r=b(a.r),a.b=b(a.b),a.g=b(a.g),"hex"===e?"#"+(1<<24|a.r<<16|a.g<<8|a.b).toString(16).slice(1):"rgb"===e?void 0===r.alpha||1===r.alpha?"rgb("+a.r+", "+a.g+", "+a.b+")":"rgba("+a.r+", "+a.g+", "+a.b+", "+s(a.alpha)+")":void 0}},converter:h,round:u,parse:o,named:g,interpolate:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgb",a=arguments[2],t=function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgb",a=n(r).channels,t={mode:r},o=function(r){t[a[r]]=e.map(function(e){return e[a[r]]})},i=0;i<a.length;i++)o(i);return t}(e.map(h(r)),r);a=a||n(r).interpolate;var o=Object.keys(a);return function(e){e=Math.min(Math.max(0,e),1);for(var n={mode:r},i=void 0,l=0;l<o.length;l++)void 0!==(i=a[o[l]](t[o[l]],e))&&(n[o[l]]=i);return n}},interpolateNumber:v,interpolateAlpha:m,interpolateHue:f,interpolateMethodLinear:p,interpolateCubehelix:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1.5,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return function(n){var o={mode:"rgb"},i=Math.pow(n,t),l=360*(e/3+r*n)*w,h=a/2*n*(1-n),u=Math.cos(l),d=Math.sin(l);return o.r=i+h*(y[0]*u+y[1]*d),o.g=i+h*(y[2]*u+y[3]*d),o.b=i+h*(y[4]*u+y[5]*d),o}},samples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;if(e<2)return e<1?[]:[.5];for(var r=[],a=0;a<e;a++)r.push(a/(e-1));return r},defineMode:t,getModeDefinition:n,default:fe});return Object.assign(fe,me),fe});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.culori=r()}(this,function(){"use strict";var e={},r={},a=[],t=function(t){e[t.mode]=Object.assign(e[t.mode]||{},t.output),Object.keys(t.input||{}).forEach(function(r){e[r]||(e[r]={}),e[r][t.mode]=t.input[r]}),r[t.mode]=t,(t.parsers||[]).forEach(function(e){return a.push(e)})},n=function(e){return r[e]},o=function(e){for(var r=void 0,t=0,n=a.length;t<n&&void 0===(r=a[t++](e)););return r},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},h=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb";return function(a){return void 0!==(a=function(e,r){return"object"!==(void 0===e?"undefined":i(e))?o(e):void 0===e.mode?l({},e,{mode:r}):e}(a,r))?a.mode===r?a:e[a.mode][r]?e[a.mode][r](a):"rgb"===r?e[a.mode].rgb(a):e.rgb[r](e[a.mode].rgb(a)):void 0}},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return function(r){return"number"==typeof r?function(e,r){return Math.round(e*(r=Math.pow(10,r)))/r}(r,e):r}},d=h("rgb"),s=u(2),b=function(e){return Math.round(255*Math.max(0,Math.min(e,1)))},g={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},c=function(e){return(e%=360)<0?e+360:e},p=function(e,r,a){return e+a*(r-e)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return function(r,a){var t=a*(r.length-1),n=Math.floor(t),o=r[n],i=r[n+1];return void 0!==o&&void 0!==i?e(o,i,t-n):void 0===o?i:o}},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function(a,t){var n=t*(a.length-1),o=Math.floor(n),i=a[o],l=a[o+1],h=n-o;return void 0!==i&&void 0!==l?(i=c(i),l=c(l),r&&Math.abs(l-i)>180?c(e(i,l-360*Math.sign(l-i),h)):e(i,l,h)):void 0===i?l:i}},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return function(r,a){var t=a*(r.length-1),n=Math.floor(t),o=r[n],i=r[n+1],l=t-n;if(!(void 0===o&&void 0===i||void 0===o&&0===l||void 0===i&&1===l))return e(void 0===o?1:o,void 0===i?1:i,l)}},y=[-.14861,1.78277,-.29227,-.90649,1.97294,0],w=Math.PI/180,k=function(e,r){if("number"==typeof e)return 3===r?{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|240&e)/255,b:(15&e|e<<4&240)/255}:4===r?{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|240&e)/255,alpha:(15&e|e<<4&240)/255}:6===r?{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(255&e)/255}:8===r?{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(255&e)/255}:void 0},M=(/([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)/+"").replace(/^\/|\/$/g,""),x=M+"%",E="(?:"+M+"%|"+M+")",$="(?:"+M+"(deg|grad|rad|turn)|"+M+")",j="\\s*,\\s*",q="\\s+",R=new RegExp("^rgba?\\(\\s*"+M+j+M+j+M+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),O=new RegExp("^rgba?\\(\\s*"+x+j+x+j+x+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),z=new RegExp("^rgba?\\(\\s*"+M+q+M+q+M+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),I=new RegExp("^rgba?\\(\\s*"+x+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),P=new RegExp("^hsla?\\(\\s*"+$+j+x+j+x+"\\s*(?:,\\s*"+E+"\\s*)?\\)$"),S=new RegExp("^hsla?\\(\\s*"+$+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),C=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,L=new RegExp("^hwb\\(\\s*"+$+q+x+q+x+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),A=new RegExp("^lab\\(\\s*"+M+q+M+q+M+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),D=new RegExp("^lch\\(\\s*"+M+q+M+q+$+"\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),H=new RegExp("^gray\\(\\s*"+M+"()()\\s*(?:\\/\\s*"+E+"\\s*)?\\)$"),N={mode:"rgb",channels:["r","g","b","alpha"],parsers:[function(e){var r;return(r=e.match(C))?k(parseInt(r[1],16),r[1].length):void 0},function(e){var r=void 0,a=void 0;if(r=e.match(R)||e.match(z))a={mode:"rgb",r:r[1]/255,g:r[2]/255,b:r[3]/255};else{if(!(r=e.match(O)||e.match(I)))return;a={mode:"rgb",r:r[1]/100,g:r[2]/100,b:r[3]/100}}return void 0!==r[4]?a.alpha=r[4]/100:void 0!==r[5]&&(a.alpha=+r[5]),a},function(e){return"string"==typeof e&&k(g[e.toLowerCase()],6)||void 0},function(e){return"transparent"===e?k(0,8):void 0}],interpolate:{r:v(),g:v(),b:v(),alpha:m()}},B=function(e){return e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},F=function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o={mode:"lrgb",r:B(r),g:B(a),b:B(t)};return void 0!==n&&(o.alpha=n),o},G=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e},J=function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o={mode:"rgb",r:G(r),g:G(a),b:G(t)};return void 0!==n&&(o.alpha=n),o},K={mode:"lrgb",output:{rgb:J},input:{rgb:F},channels:["r","g","b","alpha"],interpolate:{r:v(),g:v(),b:v(),alpha:m()}};var Q=function(e,r){switch(r){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return 360*e}},T={mode:"hsl",output:{rgb:function(e){var r=e.h,a=e.s,t=e.l,n=e.alpha;r=c(r);var o=t+a*(t<.5?t:1-t),i=o-2*(o-t)*Math.abs(r/60%2-1),l=void 0;switch(Math.floor(r/60)){case 0:l={r:o,g:i,b:2*t-o};break;case 1:l={r:i,g:o,b:2*t-o};break;case 2:l={r:2*t-o,g:o,b:i};break;case 3:l={r:2*t-o,g:i,b:o};break;case 4:l={r:i,g:2*t-o,b:o};break;case 5:l={r:o,g:2*t-o,b:i};break;default:l={r:2*t-o,g:2*t-o,b:2*t-o}}return l.mode="rgb",void 0!==n&&(l.alpha=n),l}},input:{rgb:function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsl",s:o===i?0:(o-i)/(1-Math.abs(o+i-1)),l:.5*(o+i)};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}},channels:["h","s","l","alpha"],parsers:[function(e){if("string"==typeof e){var r=e.match(P)||e.match(S);if(r){var a={mode:"hsl",h:void 0===r[3]?Q(r[1],r[2]):+r[3],s:Math.min(Math.max(0,r[4]/100),1),l:Math.min(Math.max(0,r[5]/100),1)};return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=r[7]/255),a}}}],interpolate:{h:f(),s:v(),l:v(),alpha:m()}};function U(e){var r=e.h,a=e.s,t=e.v,n=e.alpha;r=c(r);var o=Math.abs(r/60%2-1),i=void 0;switch(Math.floor(r/60)){case 0:i={r:t,g:t*(1-a*o),b:t*(1-a)};break;case 1:i={r:t*(1-a*o),g:t,b:t*(1-a)};break;case 2:i={r:t*(1-a),g:t,b:t*(1-a*o)};break;case 3:i={r:t*(1-a),g:t*(1-a*o),b:t};break;case 4:i={r:t*(1-a*o),g:t*(1-a),b:t};break;case 5:i={r:t,g:t*(1-a),b:t*(1-a*o)};break;default:i={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return i.mode="rgb",void 0!==n&&(i.alpha=n),i}function V(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsv",s:0===o?0:1-i/o,v:o};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}var W={mode:"hsv",output:{rgb:U},input:{rgb:V},channels:["h","s","v","alpha"],interpolate:{h:f(),s:v(),v:v(),alpha:m()}};var X={mode:"hsi",output:{rgb:function(e){var r=e.h,a=e.s,t=e.i,n=e.alpha;r=c(r);var o=Math.abs(r/60%2-1),i=void 0;switch(Math.floor(r/60)){case 0:i={r:t*(1+a*(3/(2-o)-1)),g:t*(1+a*(3*(1-o)/(2-o)-1)),b:t*(1-a)};break;case 1:i={r:t*(1+a*(3*(1-o)/(2-o)-1)),g:t*(1+a*(3/(2-o)-1)),b:t*(1-a)};break;case 2:i={r:t*(1-a),g:t*(1+a*(3/(2-o)-1)),b:t*(1+a*(3*(1-o)/(2-o)-1))};break;case 3:i={r:t*(1-a),g:t*(1+a*(3*(1-o)/(2-o)-1)),b:t*(1+a*(3/(2-o)-1))};break;case 4:i={r:t*(1+a*(3*(1-o)/(2-o)-1)),g:t*(1-a),b:t*(1+a*(3/(2-o)-1))};break;case 5:i={r:t*(1+a*(3/(2-o)-1)),g:t*(1-a),b:t*(1+a*(3*(1-o)/(2-o)-1))};break;default:i={r:t*(1-a),g:t*(1-a),b:t*(1-a)}}return i.mode="rgb",void 0!==n&&(i.alpha=n),i}},input:{rgb:function(e){var r=e.r,a=e.g,t=e.b,n=e.alpha,o=Math.max(r,a,t),i=Math.min(r,a,t),l={mode:"hsi",s:r+a+t===0?0:1-3*i/(r+a+t),i:(r+a+t)/3};return o-i!=0&&(l.h=60*(o===r?(a-t)/(o-i)+6*(a<t):o===a?(t-r)/(o-i)+2:(r-a)/(o-i)+4)),void 0!==n&&(l.alpha=n),l}},channels:["h","s","i","alpha"],interpolate:{h:f(),s:v(),i:v(),alpha:m()}};var Y={mode:"hwb",output:{rgb:function(e){var r=e.h,a=e.w,t=e.b,n=e.alpha;if(a+t>1){var o=a+t;a/=o,t/=o}return U({h:r,s:1===t?1:1-a/(1-t),v:1-t,alpha:n})}},input:{rgb:function(e){var r=V(e);if(void 0!==r){var a={mode:"hwb",w:(1-r.s)*r.v,b:1-r.v};return void 0!==r.h&&(a.h=r.h),void 0!==r.alpha&&(a.alpha=r.alpha),a}}},channels:["h","w","b","alpha"],parsers:[function(e){if("string"==typeof e){var r=e.match(L);if(r){var a={mode:"hwb",h:void 0===r[3]?Q(r[1],r[2]):+r[3],w:r[4]/100,b:r[5]/100};if(a.w+a.b>1){var t=a.w+a.b;a.w/=t,a.b/=t}return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=r[7]/255),a}}}],interpolate:{h:f(),w:v(),b:v(),alpha:m()}},Z=Math.pow(29,3)/Math.pow(3,3),_=Math.pow(6,3)/Math.pow(29,3),ee=function(e){return Math.pow(e,3)>_?Math.pow(e,3):(116*e-16)/Z},re=function(e){var r,a,t,n,o,i=function(e){var r=e.x,a=e.y,t=e.z;return J({r:3.1338561*r-1.6168667*a-.4906146*t,g:-.9787684*r+1.9161415*a+.033454*t,b:.0719453*r-.2289914*a+1.4052427*t})}((a=(r=e).l,t=r.a,o=(n=(a+16)/116)-r.b/200,{x:.96422*ee(t/500+n),y:1*ee(n),z:.82521*ee(o)}));return i.mode="rgb",void 0!==e.alpha&&(i.alpha=e.alpha),i},ae=function(e){return e>_?Math.cbrt(e):(Z*e+16)/116},te=function(e){var r,a,t,n,o,i,l=(r=function(e){var r=F(e),a=r.r,t=r.g,n=r.b;return{x:.4360747*a+.3850649*t+.1430804*n,y:.2225045*a+.7168786*t+.0606169*n,z:.0139322*a+.0971045*t+.7141733*n}}(e),a=r.x,t=r.y,n=r.z,o=ae(a/.96422),{mode:"lab",l:116*(i=ae(t/1))-16,a:500*(o-i),b:200*(i-ae(n/.82521))});return e.r===e.b===e.g&&(l.a=l.b=0),void 0!==e.alpha&&(l.alpha=e.alpha),l},ne={mode:"lab",output:{rgb:re},input:{rgb:te},channels:["l","a","b","alpha"],parsers:[function(e){var r=void 0,a=void 0;if(r=e.match(A))a={mode:"lab",l:+r[1],a:+r[2],b:+r[3]};else{if(!(r=e.match(H)))return;a={mode:"lab",l:+r[1],a:0,b:0}}return void 0!==r[4]?a.alpha=r[4]/100:void 0!==r[5]&&(a.alpha=+r[5]),a}],interpolate:{l:v(),a:v(),b:v(),alpha:m()}},oe=function(e){var r=e.l,a=e.a,t=e.b,n=e.alpha,o=Math.sqrt(a*a+t*t),i={mode:"lch",l:r,c:o};return o&&(i.h=c(180*Math.atan2(t,a)/Math.PI)),void 0!==n&&(i.alpha=n),i},ie=function(e){var r=e.l,a=e.c,t=e.h,n=e.alpha,o={mode:"lab",l:r,a:0===a?0:a*Math.cos(t/180*Math.PI),b:0===a?0:a*Math.sin(t/180*Math.PI)};return void 0!==n&&(o.alpha=n),o},le={mode:"lch",output:{lab:ie,rgb:function(e){return re(ie(e))}},input:{rgb:function(e){return oe(te(e))},lch:oe},channels:["l","c","h","alpha"],parsers:[function(e){var r=e.match(D);if(r){var a={mode:"lch",l:+r[1],c:Math.max(0,+r[2]),h:void 0===r[5]?Q(r[3],r[4]):+r[5]};return void 0!==r[6]?a.alpha=r[6]/100:void 0!==r[7]&&(a.alpha=+r[7]),a}}],interpolate:{h:f(),c:v(),l:v(),alpha:m()}};t(N),t(K),t(T),t(W),t(X),t(Y),t(ne),t(le),t({mode:"cubehelix",channels:["l","s","r","c"],input:{rgb:function(){}},output:{rgb:function(){}}});var he=h("rgb"),ue=h("lrgb"),de=h("hsl"),se=h("hsv"),be=h("hsi"),ge=h("hwb"),ce=h("lab"),pe=h("lch"),ve=h("cubehelix"),fe=he,me=Object.freeze({hsl:de,hsv:se,hsi:be,hwb:ge,rgb:he,lab:ce,lch:pe,lrgb:ue,cubehelix:ve,formatter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgb";return function(r){var a=d(r);return a.r=b(a.r),a.b=b(a.b),a.g=b(a.g),"hex"===e?"#"+(1<<24|a.r<<16|a.g<<8|a.b).toString(16).slice(1):"rgb"===e?void 0===r.alpha||1===r.alpha?"rgb("+a.r+", "+a.g+", "+a.b+")":"rgba("+a.r+", "+a.g+", "+a.b+", "+s(a.alpha)+")":void 0}},converter:h,round:u,parse:o,named:g,interpolate:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgb",a=arguments[2],t=function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgb",a=n(r).channels,t={mode:r},o=function(r){t[a[r]]=e.map(function(e){return e[a[r]]})},i=0;i<a.length;i++)o(i);return t}(e.map(h(r)),r);a=a||n(r).interpolate;var o=Object.keys(a);return function(e){e=Math.min(Math.max(0,e),1);for(var n={mode:r},i=void 0,l=0;l<o.length;l++)void 0!==(i=a[o[l]](t[o[l]],e))&&(n[o[l]]=i);return n}},interpolateNumber:v,interpolateAlpha:m,interpolateHue:f,interpolateMethodLinear:p,interpolateCubehelix:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-240,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return function(n){var o={mode:"rgb"},i=Math.pow(n,t),l=e+120+r*n,h=a*i*(1-i),u=Math.cos(l*w),d=Math.sin(l*w);return o.r=i+h*(y[0]*u+y[1]*d),o.g=i+h*(y[2]*u+y[3]*d),o.b=i+h*(y[4]*u+y[5]*d),o}},samples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;if(e<2)return e<1?[]:[.5];for(var r=[],a=0;a<e;a++)r.push(a/(e-1));return r},defineMode:t,getModeDefinition:n,default:fe});return Object.assign(fe,me),fe});

@@ -376,5 +376,5 @@ var converters = {};

var interpolateCubehelix = (function () {
var startcolor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
var turns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1.5;
var chroma = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
var starthue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
var endhue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -240;
var chroma = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;
var gamma = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;

@@ -389,8 +389,9 @@ return function (t) {

var theta = 360 * (startcolor / 3 + turns * t) * degToRad;
var amp = chroma / 2 * t * (1 - t);
var current_hue = starthue + 120 + endhue * t;
var cosh = Math.cos(theta);
var sinh = Math.sin(theta);
var amp = chroma * l * (1 - l);
var cosh = Math.cos(current_hue * degToRad);
var sinh = Math.sin(current_hue * degToRad);
res.r = l + amp * (M[0] * cosh + M[1] * sinh);

@@ -397,0 +398,0 @@ res.g = l + amp * (M[2] * cosh + M[3] * sinh);

{
"name": "culori",
"version": "0.2.69",
"version": "0.2.70",
"main": "build/culori.js",

@@ -5,0 +5,0 @@ "module": "build/index.js",

@@ -9,3 +9,3 @@ const M = [

export default (startcolor = 0.5, turns = -1.5, chroma = 1, gamma = 1) =>
export default (starthue = 300, endhue = -240, chroma = 0.5, gamma = 1) =>
t => {

@@ -19,8 +19,9 @@

const theta = 360 * (startcolor / 3 + turns * t) * degToRad;
const amp = chroma / 2 * t * (1 - t);
const current_hue = starthue + 120 + endhue * t;
let cosh = Math.cos(theta);
let sinh = Math.sin(theta);
const amp = chroma * l * (1 - l);
let cosh = Math.cos(current_hue * degToRad);
let sinh = Math.sin(current_hue * degToRad);
res.r = l + amp * (M[0] * cosh + M[1] * sinh);

@@ -27,0 +28,0 @@ res.g = l + amp * (M[2] * cosh + M[3] * sinh);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc