<php for ( $i=0; $i<=5; $i++ ) { $b1 = $i * 51; $b2 = 255 - $b1; echo "<td style='background-color: rgb(0,0,${b1}); color: rgb(255,255,${b2});'>rgb(0,0,${b1})</td>"; } ?>