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[1]) * 299) + (parseInt(colors[2]) * 587) + (parseInt(colors[3]) * 114)) / 1000);
         var o = Math.round(((parseInt(colors[1]) * 299) + (parseInt(colors[2]) * 587) + (parseInt(colors[3]) * 114)) / 1000);
         if (o < 125) {
         if (rgb.length && o > 125) {
             $(this).css('color', 'white');
             $(this).css('color', 'white');
         }
         }
     });
     });
});
});