GUI Code

  Home arrow GUI Code arrow Display all available background colou...
GUI CODE

Display all available background colours
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2003-07-13

    Table of Contents:

     
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement
    I wanted to choose a new background colour for my web page and although there are several web pages devoted to this I thought it could be done a better way. I chose to increment the colour value by 3 at a time.

    By : AndyC

    <?php
    print "<html>";
    print "<body>";
    print "<h1><center>Background colours</center></h1>";
    print "<table border='1' align='center'>";


    $pos = 1;
    $tabcol = 0;
    $col1 = 0;
    $col2 = 0;
    $col3 = 0;
    $col4 = 0;
    $col5 = 0;
    $col6 = 0;


    $xcolour = "0123456789ABCDEF";


    //loop statement(line)
    while ($col1 + $col2 + $col3 + $col4 +$col5 + $col6 < 90)
    {
    if ($tabcol == 0)
    {
    print "<tr>";
    }

    $tabcol = $tabcol + 1;


    $xcellcol = '#'.substr($xcolour,$col1,1).substr($xcolour,$col2,1).substr($xcolour,$col3,1).substr($xcolour,$col4,1).substr($xcolour,$col5,1).substr($xcolour,$col6,1);

    // print "<td width='10%' bgcolor='$xcellcol'>$xcellcol</td>";
    print "<td width='10%' bgcolor='$xcellcol'>";
    if ($col1 + $col3 + $col5 < 24)
    {
    print "<font color='FFFFFF'>";
    }
    print "$xcellcol</td>";
    $col6 = $col6 + 3;
    if ($col6 >15)
    {
    $col5 = $col5 + 3;
    $col6 = 0;
    if ($col5 >15)
    {
    $col4 = $col4 + 3;
    $col5 = 0;
    if ($col4 >15)
    {
    $col3 = $col3 + 3;
    $col4 = 0;
    if ($col3 >15)
    {
    $col2 = $col2 + 3;
    $col3 = 0;
    if ($col2 >15)
    {
    $col1 = $col1 + 3;
    $col2 = 0;
    }
    }
    }
    }
    }

    if ($tabcol > 5)
    {
    $tabcol = 0;
    print "</tr>";
    }

    }

    print "</table>";
    print "</body>";
    print "</html>";


    ?>

    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.

    More GUI Code Articles
    More By Codewalkers

    blog comments powered by Disqus

    GUI CODE ARTICLES

    - PHP Image Manipulation Class 1.0
    - Simple PHP-CAPTCHA,
    - dPhoto
    - nice looking dir index'r
    - Colorpicker
    - Exposure Gallery build 1226
    - Dynamic "AQUA" Buttons
    - AdminTool|1.0 for Exposure Gallery
    - Exposure Gallery v1.2
    - Crop Canvas
    - Display all available background colours
    - Exposure Gallery v1.0
    - JPEG Directory Thumbnail system (Apect ratio)
    - JPEG Directory thumbnail system
    - Change Background Color each day

    Developer Shed Affiliates

     



    © 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap