Click to See Complete Forum and Search --> : Color Selection


July 1st, 1999, 10:57 PM
Is there a standard formula that can be used to determine which color text would look good on a selected background color?
I am using the standard Color picker dialog box to let the user select a color for label, but I will want to display some text on
that label. I don't want to make the user pick the text color too, but I want it to be readable regardless of the color chosen. I
would happy to use just black or white. For example, white looks good on dark colors, but bad on White, Yellow or many lighter
colors. I am searching for a way to quickly determine whether to use Black or White text based on the RGB value returned.
Any suggestions? Thanks!

herbieII
July 1st, 1999, 11:09 PM
Try the 1's Complement of the RGB for your text color.

Roger L. McElfresh