const areGradientsEqual = (gradient1, gradient2) => {
  if (gradient1.type !== gradient2.type) {
    return false;
  }
  if (gradient1.type === "LINEAR" && gradient2.type === "LINEAR") {
    if (gradient1.angle !== gradient2.angle) {
      return false;
    }
  } else if (gradient1.type === "RADIAL" && gradient2.type === "RADIAL") {
    if (gradient1.centerX !== gradient2.centerX || gradient1.centerY !== gradient2.centerY) {
      return false;
    }
  }
  const stops1 = gradient1.stops ?? [];
  const stops2 = gradient2.stops ?? [];
  if (stops1.length !== stops2.length) {
    return false;
  }
  return stops1.every((stop1, index) => {
    const stop2 = stops2[index];
    return stop1.color?.toUpperCase() === stop2.color?.toUpperCase() && stop1.position === stop2.position;
  });
};
export {
  areGradientsEqual
};
//# sourceMappingURL=are-gradients-equal.js.map
