Problem with RGB LED function Select color for what states, Need Help fast

This Function goes in the loop problem is it starts with white blink, i close door and green comes on but when i open door again led stays green. Fault is that it doesnt change.

I have a paper due on my project in four hours and this is the only part not working so i need help fast

void ledColorControl() // conditions for the various light signals
{
 if (heaterState == false && fanState == true && doorStatus == false && earthSensor == 0 && fanFailure == false)
 {
       ledStateColor(1);//blue
 }
//  else if (heaterState == false && fanState == false && doorStatus == false && earthSensor == 0 && fanFailure == false)
//  {
//        ledStateColor(2);//green
//  }
 else if (heaterState == true && fanState == true && doorStatus == false && earthSensor == 0 && fanFailure == false)
 {
       ledStateColor(7);//blue purple toggle
 }
 else if (heaterState == false && fanState == true && doorStatus == true && earthSensor == 0 && fanFailure == false)
 {
       ledStateColor(8);//blue white toggle
 }
 else if (heaterState == false && fanState == false && doorStatus == true && earthSensor == 0 && fanFailure == false)
 {
       ledStateColor(6);//blink white
 }
 else if (heaterState == false && fanState == false && doorStatus == false && earthSensor == 1 && fanFailure == false)
 {
       ledStateColor(4);//yellow
 }
 else if ((heaterState == true && doorStatus == true) || (heaterState == true && fanState == false))
 {
       ledStateColor(3);//red
 }
 else if (heaterState == false && fanState == false && doorStatus == false && earthSensor == 0 && fanFailure == true)
 {
       ledStateColor(5);// redblink
 } 
 else
 ledStateColor(2);
}

I would consider you put everything into a single binary value, it will make the code easier to read.

Use parentheses.
if ( (heaterState == false) && (fanState == true) && (doorStatus == false) && (earthSensor == 0) && (fanFailure == false) )

If none of the above statements are true then set to green?

else
ledStateColor(2);

ya

I found the problem though since I havent got everything hooked up I got some values I didnt want, found a weakness in the same go though.