import{__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import{mix as r}from"./mix.js";import{invariant as e}from"../../../../hey-listen/dist/hey-listen.es.js";import{hex as o}from"../../../../style-value-types/dist/es/color/hex.js";import{rgba as s}from"../../../../style-value-types/dist/es/color/rgba.js";import{hsla as a}from"../../../../style-value-types/dist/es/color/hsla.js";var n=function(t,r,e){var o=t*t,s=r*r;return Math.sqrt(Math.max(0,e*(s-o)+o))},i=[o,s,a],l=function(t){return i.find((function(r){return r.test(t)}))},m=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},u=function(o,s){var i=l(o),u=l(s);e(!!i,m(o)),e(!!u,m(s)),e(i.transform===u.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var f=i.parse(o),p=u.parse(s),h=t({},f),c=i===a?r:n;return function(t){for(var e in h)"alpha"!==e&&(h[e]=c(f[e],p[e],t));return h.alpha=r(f.alpha,p.alpha,t),i.transform(h)}};export{u as mixColor,n as mixLinearColor};
//# sourceMappingURL=mix-color.js.map
