Malcolm,
I was going to suggest something along those lines.. but I think there is sort of a gray area in that midrange of brightness that might not be too legible you may want to change the breakpoint away from 128, and potentially check each color indepentdently. Like on a rgb(65,65,255) backcolor white is more readble.
>Found a solution thanks to Jim Kearns (FoxToolbox.com) and Shawn Dorian/Dan Covill on Ed Leafe's Profox list.
>
>
>*-- The function "RGBComp" is contained in FoxTools.fll. laBackColor is the
>*-- user chosen background color.
>
>llReturnValue = RGBComp(laBackColor, @lnRed, @lnGreen, @lnBlue)
>
>*-- We're trying to obtain the ideal forecolor for the user specified
>*-- backcolor. Thanks to Shawn Dorion and Dan Covill on the ProFox list
>*-- for the basis of this solution.
>
>lnForeColor = RGB(255,255,255)
>
>IF (lnRed + lnGreen + lnBlue) > (128 + 128 + 128)
>
> lnForeColor = RGB(0,0,0)
>
>ENDIF
>
>
>A tip for those reading this thread - if you need to find the background color on top of a gradient background where the gradient fade is gradual, you can use ThisForm.Point() method to determine the pixel color underneath or near a specific part of your transparent label.