i was bored couldnt get to sleep lol so read up on some php and created this websafe color chart
the headers are in xhtml mobile 1.0 but this is just incase some mobiles come across the page you use it on..
DEMO:
http://wapchat.uk.to/hex.php
SCRIPT:
ENJOY
edited: updated code..
the headers are in xhtml mobile 1.0 but this is just incase some mobiles come across the page you use it on..
DEMO:
http://wapchat.uk.to/hex.php
SCRIPT:
Code:
<?php header("Content-type: text/html; charset=UTF-8"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; /** * @author Ghost * @copyright 2008 - 2009 Ghost WebSafe Color Chart * @version (XHTML Mobile 1.0//EN) */ echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"; echo "<head>"; echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />"; echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />"; echo "<title>Ghost WebSafe Colors</title>"; // CSS FUNCTIONS FOR STYLESHEET echo "<style type=\"text/css\">"; echo ' .body { background-attachment : fixed; background-color : #FFFFFF; background-image : url(); background-position : center center; font-family : Georgia, "Times New Roman", Times, serif; font-size : small; font-style : normal; font-weight : normal; font-variant : normal; color : #0000A0; text-align : center; text-transform : none; text-decoration : none; } .table { border : 0; } a:link, a:visited, a:active { background : transparent; color : #FF0000; text-decoration : underline; } '; echo "</style>"; echo "</head>"; echo "<body class=\"body\">"; //TIME TO USE A DIV TAG HERE echo "<div>"; /* here we add the digits to make up the color codes into an array to make it easier for use to simplify the code and also by doing this the server does most of the hard work lol */ $hexcolor = array("00", "33", "66", "99", "AA", "BB", "CC", "DD", "EE", "FF", "A0"); /* TITLE FOR SCRIPT (i havent added the color: code in the span style this is because i decided to use the css code above) */ echo "<h1>Ghost Web Safe Color Chart</h1><hr/>"; /* instructions on use (i havent added the color: code in the span style this is because i decided to use the css code above) */ echo "(Choose your color then copy and paste the code)<hr/>"; //time to open a table echo "<table class=\"table\">"; //ok now we get the red colors loop for ($red=0; $red<count($hexcolor); $red++){ //ok now we get the green colors loop for ($green=0; $green<count($hexcolor); $green++){ echo "<tr>"; //ok now we Define a row for the six blue colors for ($blue=0; $blue<count($hexcolor); $blue++){ //ok now we iterate through the six blue colors $color = $hexcolor[$red].$hexcolor[$green].$hexcolor[$blue]; //ok now At this point we decide what text/font color to use if ( $hexcolor[$red] <= "99" && $hexcolor[$green] <= "99" && $hexcolor[$blue] <= "99"){ //ok now we Use a white font if the color is going to be quite dark echo "<td style=\"width:200px;background-color:#".$color.";\"> ".$color." </td>"; } else { //ok now we Use a black font on the lighter colors echo "<td style=\"width:200px;background-color:#".$color.";\"> ".$color." </td>"; //ok now we End the loop which is blue } //ok now we close row after writing the six color cells } echo "</tr>\n"; //ok now we End the loop which is green } //ok now we End the loop which is red } //time to close the table echo "</table>\n"; //MY COPYRIGHT echo "© Ghost WebSafe Color Chart - ".date(Y); //NOW TIME TO CLOSE OUR EARLIER DIV TAG echo "</div>"; echo "</body>\n"; echo "</html>\n"; ?>
edited: updated code..
Comment