The line
if(color = 255,255,255)
probably does do what you think it does.
First, in C++, operator = is assignment operator and not equality operator.
Second, in C++, a comma allows multiple expressions when normally one expression is expected and the result is taken from the rightmost one.
Thus, that statement would essentially be equivalent to:
255;
255;
color = 255;
if (color) { ... }
For more information, take a look at:
http://www.cplusplus.com/doc/tutorial/operators/[
^]
And also:
http://msdn.microsoft.com/en-us/library/zs06xbxh(v=VS.100).aspx[
^]