Websafe Color Chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Websafe Color Chart

    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:
    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 &#39;
    .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;
        }
    &#39;;
    
    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";
    ?>
    ENJOY

    edited: updated code..
    <?php
    include ('Ghost');
    if ($Post == true) {
    echo '

    sigpic
    alt='coding-talk.com!!' />';
    echo 'Sharing Is Caring!';
    } else {
    echo '

    alt='the username GHOST has been comprimised!' />';
    echo 'OMG SOMEBODY HELP ME!!';
    }
    ?>

    #2
    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:
    <div class='codetop'>CODE
    <div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?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 &#39;
    .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;
    }
    &#39;;

    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
    echo "<h1>Ghost Web Safe Color Chart</h1><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";
    ?></div>

    ENJOY[/b][/quote]

    wow nice1!
    thanks
    It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
    ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
    ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
    キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

    Comment


      #3
      your welcome bro hope it comes in handy for someone like yourself.. enjoy..
      <?php
      include ('Ghost');
      if ($Post == true) {
      echo '

      sigpic
      alt='coding-talk.com!!' />';
      echo 'Sharing Is Caring!';
      } else {
      echo '

      alt='the username GHOST has been comprimised!' />';
      echo 'OMG SOMEBODY HELP ME!!';
      }
      ?>

      Comment


        #4
        can a phone even open that page?

        Comment


          #5
          can a phone even open that page?[/b]
          my phone does yes.. but this was made for pcs not phones persay.. but if you remove some letters out of the ARRAY ie: "AA" "EE" etc it will choose less colors and mobiles will defo be able to few it.. i have tried this and defo works amylee hun..
          <?php
          include ('Ghost');
          if ($Post == true) {
          echo '

          sigpic
          alt='coding-talk.com!!' />';
          echo 'Sharing Is Caring!';
          } else {
          echo '

          alt='the username GHOST has been comprimised!' />';
          echo 'OMG SOMEBODY HELP ME!!';
          }
          ?>

          Comment


            #6
            can a phone even open that page?[/b]
            i&#39;ve checked this on N70 with opera symbian and netfront
            and it show colors ok
            It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
            ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
            ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
            キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

            Comment

            Working...
            X