I am not sure if this is what you can use , but I allow the user to set a form to any color. So in the form GotFocus, I check that he hasn't made it ugly, like black letters on black background or vice-versa,
I picked a form backcolor value that is approximately in the middle of 0 to the largest it can get.
IF thisform.BackColor > 13882192
thisform.label1.ForeColor = 0
... and so on
HTH
Ron Seidl
Independent Developer
VFP
"I'm playing in life's theater in anticipation of a great cast party!"