FANDOM


//
$(function () {
 
    var topUl = $('ul.comments');
 
    function isBright (color) {
        var m = color.match(/(?:([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2}))|(?:(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3}))/);
        if (!m) return false;
        var rgb = m[1] ? { r: parseInt(m[1], 16), g: parseInt(m[2], 16), b: parseInt(m[3], 16) }
                       : { r: parseInt(m[4], 10), g: parseInt(m[5], 10), b: parseInt(m[6], 10) };
        return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000 >= 128;
    }
 
    function getBackColor () {
        var bgColor = $('#WikiaPageBackground').css('background-color');
        if ('transparent' == bgColor) bgColor = $('#WikiaPage').css('background-color');
        if ('transparent' == bgColor) bgColor = $('#EditPageHeader').css('background-color');
        return bgColor;
    }
 
    topUl.addClass(isBright(getBackColor()) ? 'bg-bright' : 'bg-dark');
});
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.