Eric Wieser 24 December 2010 Don’t be silly, this doesn’t work: function getContrast50(hexcolor){ return (parseInt(hexcolor, 16) > 0xffffff/2) ? ‘black’:‘white’; } That’ll say a background color of #010000 should have black text, and a background color of #7FFFFF should have white text. That’s ludicrous!
Don’t be silly, this doesn’t work:
function getContrast50(hexcolor){ return (parseInt(hexcolor, 16) > 0xffffff/2) ? ‘black’:‘white’; }That’ll say a background color of #010000 should have black text, and a background color of #7FFFFF should have
white text. That’s ludicrous!