Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding contrasting colors
Message
From
23/10/2002 18:38:37
Jonathan Cochran
Alion Science and Technology
Maryland, United States
 
 
To
23/10/2002 17:26:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00714574
Message ID:
00714591
Views:
10
Although this doesn't directly answer your question, maybe this will do what you want. It takes colors from the user's Windows color settings.
lo_TextBox = CREATEOBJECT("TextBox")
lc_BackColor = TRANSFORM(lo_TextBox.BACKCOLOR)
lc_ForeColor = TRANSFORM(lo_TextBox.FORECOLOR)
lc_SelectedBackColor = TRANSFORM(lo_TextBox.SELECTEDBACKCOLOR)
lc_SelectedForeColor = TRANSFORM(lo_TextBox.SELECTEDFORECOLOR)
lo_TextBox = .NULL.
THISFORM.Grid1.SETALL( "DynamicBackColor", "IIF( ll_Test, " + lc_SelectedBackColor + ", " + lc_BackColor + ")", "Column" )
THISFORM.Grid1.SETALL( "DynamicForeColor", "IIF( ll_Test, " + lc_SelectedForeColor + ", " + lc_ForeColor + ")", "Column" )
>Hello
>I have a grid where the backcolor is set at runtime using the dynamicbackcolor property
>
>I need to make the text readable no matter the back color. I tried setting dynamicforecolor to bitxor(dynamicbackcolor, rgb(255,255,255)), but the results are disgusting
>
>I want to set dynamicforecolor to black if the back color is light and to white if the back color is dark. But I cannot find a function that reliably tells me the "intensity" or "luminance" of the color...
>
>Thanks!
Previous
Reply
Map
View

Click here to load this message in the networking platform