Handle it like this, instead of just if'ing everything, make into a switch statement, it is processed faster then if's:
PHP Code:
switch($color) {
case "red":
$bg = "color code";
break;
case "green":
$bg = "color code";
break;
case "blue":
$bg = "color code";
default:
$bg = "default color";
break;
}
This is highly adaptable since you can add more a lot easier then if statements, and it is the preferred way to handle conditionals..