"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../value/types/color/hex.mjs.js"),r=require("../../value/types/color/hsla.mjs.js"),s=require("../../value/types/color/hsla-to-rgba.mjs.js"),o=require("../../value/types/color/rgba.mjs.js"),a=require("./immediate.mjs.js"),t=require("./number.mjs.js"),l=require("../../../../../motion-utils/dist/es/errors.mjs.js");const n=(e,r,s)=>{const o=e*e,a=s*(r*r-o)+o;return a<0?0:Math.sqrt(a)},i=[e.hex,o.rgba,r.hsla];function u(e){const o=(a=e,i.find((e=>e.test(a))));var a;if(l.warning(Boolean(o),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(o))return!1;let t=o.parse(e);return o===r.hsla&&(t=s.hslaToRgba(t)),t}exports.mixColor=(e,r)=>{const s=u(e),l=u(r);if(!s||!l)return a.mixImmediate(e,r);const i={...s};return e=>(i.red=n(s.red,l.red,e),i.green=n(s.green,l.green,e),i.blue=n(s.blue,l.blue,e),i.alpha=t.mixNumber(s.alpha,l.alpha,e),o.rgba.transform(i))},exports.mixLinearColor=n;
//# sourceMappingURL=color.mjs.js.map
