!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n||self).colorBlend={})}(this,function(n){function t(n,t,r){return{r:255*r(n.r/255,t.r/255),g:255*r(n.g/255,t.g/255),b:255*r(n.b/255,t.b/255)}}function r(n,t){return t}function u(n,t){return n*t}function o(n,t){return n+t-n*t}function i(n,t){return g(t,n)}function e(n,t){return Math.min(n,t)}function f(n,t){return Math.min(Math.max(n,t),1)}function c(n,t){return 0===n?0:1===t?1:Math.min(1,n/(1-t))}function a(n,t){return 1===n?1:0===t?0:1-Math.min(1,(1-n)/t)}function g(n,t){return t<=.5?u(n,2*t):o(n,2*t-1)}function b(n,t){return t<=.5?n-(1-2*t)*n*(1-n):n+(2*t-1)*((n<=.25?((16*n-12)*n+4)*n:Math.sqrt(n))-n)}function h(n,t){return Math.abs(n-t)}function d(n,t){return n+t-2*n*t}function l(n,t,r){return Math.min(Math.max(n||0,t),r)}function M(n){return{r:l(n.r,0,255),g:l(n.g,0,255),b:l(n.b,0,255),a:l(n.a,0,1)}}function m(n){return{r:255*n.r,g:255*n.g,b:255*n.b,a:n.a}}function p(n){return{r:n.r/255,g:n.g/255,b:n.b/255,a:n.a}}function s(n,t){void 0===t&&(t=0);var r=Math.pow(10,t);return{r:Math.round(n.r*r)/r,g:Math.round(n.g*r)/r,b:Math.round(n.b*r)/r,a:n.a}}function v(n,t,r,u,o,i){return(1-t/r)*u+t/r*Math.round((1-n)*o+n*i)}function x(n,t,r,u,o){void 0===o&&(o={unitInput:!1,unitOutput:!1,roundOutput:!0}),o.unitInput&&(n=m(n),t=m(t)),n=M(n);var i=(t=M(t)).a+n.a-t.a*n.a,e=r(n,t,u),f=M({r:v(n.a,t.a,i,n.r,t.r,e.r),g:v(n.a,t.a,i,n.g,t.g,e.g),b:v(n.a,t.a,i,n.b,t.b,e.b),a:i});return o.unitOutput?p(f):o.roundOutput?s(f):s(f,9)}function y(n,t,r){return m(r(p(n),p(t)))}function O(n){return.3*n.r+.59*n.g+.11*n.b}function B(n,t){var r=t-O(n);return function(n){var t=O(n),r=n.r,u=n.g,o=n.b,i=Math.min(r,u,o),e=Math.max(r,u,o);function f(n){return t+(n-t)*t/(t-i)}function c(n){return t+(n-t)*(1-t)/(e-t)}return i<0&&(r=f(r),u=f(u),o=f(o)),e>1&&(r=c(r),u=c(u),o=c(o)),{r:r,g:u,b:o}}({r:n.r+r,g:n.g+r,b:n.b+r})}function I(n){return Math.max(n.r,n.g,n.b)-Math.min(n.r,n.g,n.b)}function L(n,t){var r=["r","g","b"].sort(function(t,r){return n[t]-n[r]}),u=r[0],o=r[1],i=r[2],e={r:n.r,g:n.g,b:n.b};return e[i]>e[u]?(e[o]=(e[o]-e[u])*t/(e[i]-e[u]),e[i]=t):e[o]=e[i]=0,e[u]=0,e}function T(n,t){return B(L(t,I(n)),O(n))}function j(n,t){return B(L(n,I(t)),O(n))}function k(n,t){return B(t,O(n))}function q(n,t){return B(n,O(t))}n.color=function(n,t){return x(n,t,y,k)},n.colorBurn=function(n,r){return x(n,r,t,a)},n.colorDodge=function(n,r){return x(n,r,t,c)},n.darken=function(n,r){return x(n,r,t,e)},n.difference=function(n,r){return x(n,r,t,h)},n.exclusion=function(n,r){return x(n,r,t,d)},n.hardLight=function(n,r){return x(n,r,t,g)},n.hue=function(n,t){return x(n,t,y,T)},n.lighten=function(n,r){return x(n,r,t,f)},n.luminosity=function(n,t){return x(n,t,y,q)},n.multiply=function(n,r){return x(n,r,t,u)},n.normal=function(n,u){return x(n,u,t,r)},n.overlay=function(n,r){return x(n,r,t,i)},n.saturation=function(n,t){return x(n,t,y,j)},n.screen=function(n,r){return x(n,r,t,o)},n.softLight=function(n,r){return x(n,r,t,b)}});
//# sourceMappingURL=index.umd.js.map
