function t(t,n,u){return{r:255*u(t.r/255,n.r/255),g:255*u(t.g/255,n.g/255),b:255*u(t.b/255,n.b/255)}}function n(t,n){return n}function u(t,n){return t*n}function r(t,n){return t+n-t*n}function i(t,n){return a(n,t)}function o(t,n){return Math.min(t,n)}function c(t,n){return Math.min(Math.max(t,n),1)}function e(t,n){return 0===t?0:1===n?1:Math.min(1,t/(1-n))}function f(t,n){return 1===t?1:0===n?0:1-Math.min(1,(1-t)/n)}function a(t,n){return n<=.5?u(t,2*n):r(t,2*n-1)}function p(t,n){return n<=.5?t-(1-2*n)*t*(1-t):t+(2*n-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function b(t,n){return Math.abs(t-n)}function g(t,n){return t+n-2*t*n}function O(t,n,u){return Math.min(Math.max(t||0,n),u)}function h(t){return{r:O(t.r,0,255),g:O(t.g,0,255),b:O(t.b,0,255),a:O(t.a,0,1)}}function I(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function M(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function m(t,n=0){const u=Math.pow(10,n);return{r:Math.round(t.r*u)/u,g:Math.round(t.g*u)/u,b:Math.round(t.b*u)/u,a:t.a}}function s(t,n,u,r,i,o){return(1-n/u)*r+n/u*Math.round((1-t)*i+t*o)}function d(t,n,u,r,i={unitInput:!1,unitOutput:!1,roundOutput:!0}){i.unitInput&&(t=I(t),n=I(n)),t=h(t);const o=(n=h(n)).a+t.a-n.a*t.a,c=u(t,n,r);let e=h({r:s(t.a,n.a,o,t.r,n.r,c.r),g:s(t.a,n.a,o,t.g,n.g,c.g),b:s(t.a,n.a,o,t.b,n.b,c.b),a:o});return e=i.unitOutput?M(e):i.roundOutput?m(e):function(t){return m(t,9)}(e),e}function x(t,n,u){return I(u(M(t),M(n)))}function l(t){return.3*t.r+.59*t.g+.11*t.b}function q(t,n){const u=n-l(t);return function(t){const n=l(t);let{r:u,g:r,b:i}=t;const o=Math.min(u,r,i),c=Math.max(u,r,i);function e(t){return n+(t-n)*n/(n-o)}function f(t){return n+(t-n)*(1-n)/(c-n)}return o<0&&(u=e(u),r=e(r),i=e(i)),c>1&&(u=f(u),r=f(r),i=f(i)),{r:u,g:r,b:i}}({r:t.r+u,g:t.g+u,b:t.b+u})}function w(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function j(t,n){const u=["r","g","b"].sort((n,u)=>t[n]-t[u]),r=u[0],i=u[1],o=u[2],c={r:t.r,g:t.g,b:t.b};return c[o]>c[r]?(c[i]=(c[i]-c[r])*n/(c[o]-c[r]),c[o]=n):c[i]=c[o]=0,c[r]=0,c}function k(t,n){return q(j(n,w(t)),l(t))}function v(t,n){return q(j(t,w(n)),l(t))}function y(t,n){return q(n,l(t))}function z(t,n){return q(t,l(n))}function A(u,r){return d(u,r,t,n,{unitInput:!0,unitOutput:!0})}function B(n,r){return d(n,r,t,u,{unitInput:!0,unitOutput:!0})}function C(n,u){return d(n,u,t,r,{unitInput:!0,unitOutput:!0})}function D(n,u){return d(n,u,t,i,{unitInput:!0,unitOutput:!0})}function E(n,u){return d(n,u,t,o,{unitInput:!0,unitOutput:!0})}function F(n,u){return d(n,u,t,c,{unitInput:!0,unitOutput:!0})}function G(n,u){return d(n,u,t,e,{unitInput:!0,unitOutput:!0})}function H(n,u){return d(n,u,t,f,{unitInput:!0,unitOutput:!0})}function J(n,u){return d(n,u,t,a,{unitInput:!0,unitOutput:!0})}function K(n,u){return d(n,u,t,p,{unitInput:!0,unitOutput:!0})}function L(n,u){return d(n,u,t,b,{unitInput:!0,unitOutput:!0})}function N(n,u){return d(n,u,t,g,{unitInput:!0,unitOutput:!0})}function P(t,n){return d(t,n,x,k,{unitInput:!0,unitOutput:!0})}function Q(t,n){return d(t,n,x,v,{unitInput:!0,unitOutput:!0})}function R(t,n){return d(t,n,x,y,{unitInput:!0,unitOutput:!0})}function S(t,n){return d(t,n,x,z,{unitInput:!0,unitOutput:!0})}export{R as color,H as colorBurn,G as colorDodge,E as darken,L as difference,N as exclusion,J as hardLight,P as hue,F as lighten,S as luminosity,B as multiply,A as normal,D as overlay,Q as saturation,C as screen,K as softLight};
//# sourceMappingURL=index.modern.js.map
