import {
  combineHexWithOpacity,
  getOpacityFromHex
} from "./../wix-rich-content-common/Utils/color-utils.js";
function resolveBackwardCompatOverlay(color, imageOpacity, opacityMax) {
  if (imageOpacity >= opacityMax || getOpacityFromHex(color) !== 100) {
    return color;
  }
  const alpha = opacityMax === 1 ? (1 - imageOpacity) * 100 : opacityMax - imageOpacity;
  return combineHexWithOpacity(color, alpha) ?? color;
}
export {
  resolveBackwardCompatOverlay
};
//# sourceMappingURL=resolve-backward-compat-overlay.js.map
