MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 273: Line 273:
     $('table[cellpadding="5"][border="1"][style] tr').each(function () {
     $('table[cellpadding="5"][border="1"][style] tr').each(function () {
         let rgb = $(this).css('backgroundColor');
         let rgb = $(this).css('backgroundColor');
         let colors = rgb.match(/\d+/g);
         // let colors = rgb.match(/\d+/g);
         let o = Math.round(((parseInt(colors[1]) * 299) + (parseInt(colors[2]) * 587) + (parseInt(colors[3]) * 114)) / 1000);
         // let o = Math.round(((parseInt(colors[1]) * 299) + (parseInt(colors[2]) * 587) + (parseInt(colors[3]) * 114)) / 1000);
         if (o < 125) {
         // if (o < 125) {
            $(this).css('color', 'white');
        //    $(this).css('color', 'white');
         }
         // }
     });
     });
});
});