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($i, 10, 16);
for($j = 0; $j<=15; $j++){
$hexj = base_convert($j, 10, 16);
for($k = 0; $k<=15; $k++){
$hexk = base_convert($k, 10, 16);
for($l = 0; $l<=15; $l++){
$hexl = base_convert($l, 10, 16);
for($m = 0; $m<=15; $m++){
$hexm = base_convert($m, 10, 16);
for($n = 0; $n<=15; $n++){
$hexn = base_convert($n, 10, 16);
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