Results 1 to 3 of 3

Thread: colors in vb

  1. #1
    bzemer
    Guest

    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..

  2. #2
    jim mcnamara
    Guest
    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



  3. #3
    bzemer
    Guest

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width