while($col_b <= 255) { $red = strtoupper(dechex($col_r)); $green = strtoupper(dechex($col_g)); $blue = strtoupper(dechex($col_b)); $color = str_pad($red, 2, '0', STR_PAD_LEFT)."".str_pad($green, 2, '0', STR_PAD_LEFT)."".str_pad($blue, 2, '0', STR_PAD_LEFT); ?> <a onMouseDown="setColor('<?php echo $color ?>')" style="cursor: hand; background: #<?php echo $color ?>;"><?php echo $fill; ?></a> <?php // Form the row of 6 colors... $row_return++; if($row_return==6) { echo "<br>"; $row_return = 0; } $col_b+=51; // decrement for more colors, but be carefull, there are over 16 Million colors } $col_g+=51; // decrement for more colors, but be carefull, there are over 16 Million colors } $col_r+=51; // decrement for more colors, but be carefull, there are over 16 Million colors
// deal with the end rows in order to display the colors in a table... if($block_return == 3) { echo "</td></tr><tr>"; }else { echo "</td>"; } } echo "</tr></table>"; // end row & table
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.