In trying to check that R, G, B gives white then would this statement suffice:
Code:if (R == G == B == 255) { .... }
Thanks
In trying to check that R, G, B gives white then would this statement suffice:
Code:if (R == G == B == 255) { .... }
Thanks
Last edited by paulogrady; 04-12-2009 at 11:04 AM.
No.
Code:if (R == 255 && G == 255 && B == 255) { }
I hate real numbers.
Thanks for the fast answer !
No, you are looking to use ||, e.g., R == 255 || G == 255.
EDIT:
Oh yes, since you actually want all three to match 255, then yes && would be correct, not ||.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
@Above: As far as I know, white is when (R == 255 && G == 255 && B == 255).
And like loxman said compare all to 255 or
if (R == G && G == B && B == 255) ...
Last edited by Brafil; 04-12-2009 at 11:09 AM.