I use this 4 liner alot to flip between colors in generated tables (used on home page and within thread displays here):
$bg++;
$bg=0 if $bg > 1;
$bgcolor ="fafafa";
$bgcolor ="ffffff" if $bg;
Example <tr bgcolor="#$bgcolor">
Got a quicker way to to the 4 lines?