You could pass the (rgba) color for each link using a (HTML5) data-*
attribute like :
<a data-color="246, 150, 121, 1" class="fancybox fancybox.iframe" href="{link}">show</a>
<a data-color="209, 209, 209, 1" class="fancybox fancybox.iframe" href="{link}">golden hour</a>
Then fetch the color within the beforeShow
callback and pass it to the helpers
using the $.extend() method like :
jQuery(document).ready(function ($) {
$(".fancybox").fancybox({
beforeShow: function () {
var _color = "rgba(" + $(this.element).data("color") + ")";
$.extend(this, {
helpers: { overlay: { css: { background: _color } } }
});
}
});
}); // ready