nuxy Posted November 13, 2007 Share Posted November 13, 2007 Hello there, I was just thinking that I wanted to make an color chart, that you would be able to give a color code for text, and the script will display the background color code from a cell. Bit confusing, but never the less, this is just some personal think I would like to make for myself. I have worked out a way to display all the colors, based on the number of characters in a color code, versus the available character you can use. But I wanted to know if I could in a way, group the colors. Like shades of red goes together, shades of green, blue, yellow, white and so forth. I'm not an expert with what codes produce what colors, so this is a bit frustrating for me. Here is my current script. <?php $codes = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'); $read = array(); echo '<table style="background:#1d1d1d;border-spacing:5px"><tr>'; for ($s = 0; $s <= 1536; $s++) { $c++; while (strlen($string) != 6) { $string .= $codes[rand(0, 16)]; } if (!in_array($string, $read)) { echo '<td style="font-family:tahoma;font-size:9px;color:#' . $_GET['c'] . ';text-align:center;padding:5px;width:40px;heigth:20px;background-color: #' . $string . ';">#' . $string . '</td> '; $read[] = $string; unset($string); } if ($c == 20) { echo ' </tr><tr>'; $c = 0; } } echo '</table>'; ?> Anyone have any ideas? Thanks! Quote Link to comment Share on other sites More sharing options...
nuxy Posted November 13, 2007 Author Share Posted November 13, 2007 Wooh, sorry for the double post. The script(this website, Post.php) come up with an error that the MySQL server had gone away. Strange, anyways, sorry.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.