High contrast colours

I had occasion recently to need to find a foreground colour that worked well with a variety of backgrounds. Backgrounds that included black, white, a couple of shades of grey, and a blue like you find with highlighted or selected fields and active buttons. I started...