-
colors in vb
Hi,
What if i want my user to be able to pick colors from the common dialog and then find out if the colors he chose are in a shade of gray that simmilar to the background of a picturebox.
Can i find out if the color is in some of the shades of gray that i don't want him to use?
the important thing in this question is not how i find which color he chose, but how do i know if it is similar to the background of the picturebox in several close shades.
thanks..
-
Luminance is a way of mapping physiological perception of color onto a gray scale. Two colors with identical luminances may be REALLY hard to discern from each other. I hope this is what you mean.
For RGB colors
luminance = 0.299*Red + 0.587*Green + 0.114*Blue
You want luminances that are >110% or <90% of the luminance value you get for your gray background.
hth
:)
-
what needs to be done..
if i have a picture box with this color in the back: &H8000000F&
and i want the user to be able to change the back color of that picture box, but i don't want it to be the same color or a similar color because of the content of the picture box, then how can i use luminance to not allow the user a few shades up and down from that gray (&H8000000F&) color?