function getContrast50(hex){ return (parseInt(hex, 16) > 0xffffff/2) ? 'black': 'white'; }