ElEditors, Interface administrators, Administrators
70,866
edits
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 | if (rgb.length && o > 125) { | ||
$(this).css('color', 'white'); | $(this).css('color', 'white'); | ||
} | } | ||
}); | }); | ||
}); | }); |