I’m just building a website for my small anti-spam verification code, vericode.
There are a few configurable options, background colour being one of them, and to make sure the text is still visible, i used the following PHP to do a simple test against “half of white”, and return either black or white text:
$bgColour = ‘eaeaea’;
$textColour = (hexdec($bgColour) < 0xffffff/2) ? ‘fff’:’000′;