Fedora Linux Support Community & Resources Center
  #1  
Old 16th March 2007, 07:20 PM
xeonman9000 Offline
Registered User
 
Join Date: Feb 2006
Location: York, England
Age: 25
Posts: 207
Talking PHP HTML Colour Chart Problem

Hi,
I'm trying to create a colour chart with all 16.8 million colours on it from 000000 to ffffff but I can't seem to work out what order the 6 hex-value decimals should go in to produce a smooth transition between all the colours. Here is my code.

PHP Code:
<html>
<head>
<title>Table Of Colours</title>
</head>
<body>
<center>
<table border="2">
<?php
for($i 0$i<=15$i++){
    echo 
"<tr>\n";
    
$hexi base_convert($i1016);
    for(
$j 0$j<=15$j++){
        
$hexj base_convert($j1016);
        for(
$k 0$k<=15$k++){
            
$hexk base_convert($k1016);
            for(
$l 0$l<=15$l++){
                
$hexl base_convert($l1016);
                for(
$m 0$m<=15$m++){
                    
$hexm base_convert($m1016);
                    for(
$n 0$n<=15$n++){
                        
$hexn base_convert($n1016);
                        echo 
"<td align=\"center\" bgcolor=\"#" $hexi $hexj $hexk $hexl $hexm $hexn "\"><font color=\"#" $hexi $hexj $hexk $hexl $hexm $hexn "\">#" $hexi $hexj $hexk $hexl $hexm $hexn "</font></td>\n";
                    }
                }
            }
            echo 
"</tr>\n";
        }
    }
}
echo 
"</tr>\n";
?>
</table>
</center>
</body>
</html>
I thought i,j,k,l,m,n would work but it doesn't it creates little 16x16 squares of colours, the problem is, I'm not quite sure how it will look in my head, never mind when programming it.
__________________
http://www.ridethespiral.co.uk/
::Specs::
Intel Core 2 Duo E6400 CPU
Gigabyte GA-965P-DS3
2x1024Mb Patriot DDRII-800MHz RAM
320Gb Seagate Barracuda (SATA)
200Gb Seagate Barracuda
80Gb Seagate Barracuda
NEC SATA DVD-RAM drive
Sony Floppy Drive
X-Pro Card Reader
380-watt Coolermaster eXtreme PSU
BFG 256Mb 7600GT OC graphics card
C-media soundcard
Dual LG L194WT 19" widescreen monitors
Registered Linux User: #423549
Reply With Quote
  #2  
Old 16th March 2007, 07:28 PM
BandC's Avatar
BandC Offline
Registered User
 
Join Date: Nov 2004
Posts: 1,105
Hmm, I wonder if browsers can handle a table with 16 million cells. Look at some of the color charts in graphics programs like GIMP and see where they cut off the horizontal lines. Unfortunately, I can't try your code this instant. I might be able to later.
__________________
IMHO GNOME FTW! BTW KDE WAD? FWIW. HTH. AFAIK YMMV. OMG WTF BBQ! :rolleyes:

Do you like surfing forums but wish people would stop using obscure abbreviations and acronyms?
Then my Firefox/Chrome extension ABBREX is for you!
It automatically adds hover tooltips to abbreviations displaying their meanings on any web page you visit!

Check it out at: http://abbrex.com
Reply With Quote
  #3  
Old 16th March 2007, 09:38 PM
xeonman9000 Offline
Registered User
 
Join Date: Feb 2006
Location: York, England
Age: 25
Posts: 207
Hmmm, I just ran it and I got tons of blues and greens, then it gave up. With 2Gb of RAM, I was still using 470Mb of Swap Space. maybe I'll do it with a few less colours.
__________________
http://www.ridethespiral.co.uk/
::Specs::
Intel Core 2 Duo E6400 CPU
Gigabyte GA-965P-DS3
2x1024Mb Patriot DDRII-800MHz RAM
320Gb Seagate Barracuda (SATA)
200Gb Seagate Barracuda
80Gb Seagate Barracuda
NEC SATA DVD-RAM drive
Sony Floppy Drive
X-Pro Card Reader
380-watt Coolermaster eXtreme PSU
BFG 256Mb 7600GT OC graphics card
C-media soundcard
Dual LG L194WT 19" widescreen monitors
Registered Linux User: #423549
Reply With Quote
  #4  
Old 16th March 2007, 10:06 PM
BandC's Avatar
BandC Offline
Registered User
 
Join Date: Nov 2004
Posts: 1,105
How about instead of using table cells painting one pixel per one / many color(s) using the GD library? It may still be too much (~4000x~4000 pixels) so obviously the color chart programs are cheating by omitting many colors. Maybe you should too.
__________________
IMHO GNOME FTW! BTW KDE WAD? FWIW. HTH. AFAIK YMMV. OMG WTF BBQ! :rolleyes:

Do you like surfing forums but wish people would stop using obscure abbreviations and acronyms?
Then my Firefox/Chrome extension ABBREX is for you!
It automatically adds hover tooltips to abbreviations displaying their meanings on any web page you visit!

Check it out at: http://abbrex.com
Reply With Quote
  #5  
Old 16th March 2007, 11:25 PM
xeonman9000 Offline
Registered User
 
Join Date: Feb 2006
Location: York, England
Age: 25
Posts: 207
Hmmm, good idea, unfortunately I don't know enough PHP to do that. I'm not making this for any practical purpous, just for fun.
__________________
http://www.ridethespiral.co.uk/
::Specs::
Intel Core 2 Duo E6400 CPU
Gigabyte GA-965P-DS3
2x1024Mb Patriot DDRII-800MHz RAM
320Gb Seagate Barracuda (SATA)
200Gb Seagate Barracuda
80Gb Seagate Barracuda
NEC SATA DVD-RAM drive
Sony Floppy Drive
X-Pro Card Reader
380-watt Coolermaster eXtreme PSU
BFG 256Mb 7600GT OC graphics card
C-media soundcard
Dual LG L194WT 19" widescreen monitors
Registered Linux User: #423549
Reply With Quote
  #6  
Old 21st March 2007, 06:50 PM
BandC's Avatar
BandC Offline
Registered User
 
Join Date: Nov 2004
Posts: 1,105
It shouldn't be that hard. Here you go:

http://www.php.net/manual/en/function.imagesetpixel.php
__________________
IMHO GNOME FTW! BTW KDE WAD? FWIW. HTH. AFAIK YMMV. OMG WTF BBQ! :rolleyes:

Do you like surfing forums but wish people would stop using obscure abbreviations and acronyms?
Then my Firefox/Chrome extension ABBREX is for you!
It automatically adds hover tooltips to abbreviations displaying their meanings on any web page you visit!

Check it out at: http://abbrex.com
Reply With Quote
Reply

Tags
chart, colour, html, php, problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Office chart crash igknighted Using Fedora 4 13th February 2007 09:18 PM
Odd html problem, or maybe just me? paramedic233 Using Fedora 3 7th December 2006 12:27 AM
Flow ChaRT sgtbob Using Fedora 2 15th June 2006 01:30 PM


Current GMT-time: 20:14 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat