Results 1 to 10 of 10

Thread: How to tell if a color is light or dark?

Threaded View

  1. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    I don't agree with you.

    Unless the way i'm getting the RGB numbers is different than the way you get them, if a value is larger than 200 then it is going to be lighter.
    I reckon, if R + G + B > 330 then it is light, but if it is less then its dark.
    Just my findings.
    Let me know what you think, i can post the code if needed.
    BW
    ps however having a value of 200+ for G by itself needs to also change from white text to black, as its too bright
    This is the code i ended up using
    Code:
        If (intRed + intGreen + intBlue < 350) And (intGreen < 200) Then
            Label1.ForeColor = vbWhite
        Else
            Label1.ForeColor = vbBlack
        End If
    Last edited by But_Why; Jan 31st, 2001 at 08:32 PM.

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