MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 275: Line 275:
         var colors = rgb.match(/\d+/g);
         var colors = rgb.match(/\d+/g);
         var o = Math.round(((parseInt(colors[0]) * 299) + (parseInt(colors[1]) * 587) + (parseInt(colors[2]) * 114)) / 1000);
         var o = Math.round(((parseInt(colors[0]) * 299) + (parseInt(colors[1]) * 587) + (parseInt(colors[2]) * 114)) / 1000);
         if (o > 125) {
         if (o < 125 && rgb != 'rgba(0, 0, 0, 0)') {
            $(this).css('color', 'black');
             $(this).css('color', 'white').css('text-shadow', '1px 1px 1px #000');
        } else if (rgb != 'rgba(0, 0, 0, 0)') {
             $(this).css('color', 'white');
         }
         }
     });
     });
});
});