Hur får jag denna kod att visa fler rutor och med andra färger? Å hur får jag den å funkar i Netscape? Eller finns det någon bra liknande kod för detta???
http://www.gruvsjo.com/hex.asp
<html>
<head>
<style>
INPUT {font-family:verdana; font-size:11px; width:70px}
.fargCl {width:70px; height:40px; background-color:#666666; border:1px white solid}
.boxar {width:10px; height:10px; cursor:hand}
</style>
<script>
//--©opyright Andreas Schöndell
//--andreas_schondell@hotmail.com
var r=6, g=6, b=6;
function fixxahex(x) {
switch (x) {
case 10: hex='A'; break;
case 11: hex='B'; break;
case 12: hex='C'; break;
case 13: hex='D'; break;
case 14: hex='E'; break;
case 15: hex='F'; break;
default: hex=x+'';
}
return hex;
}
function skrivFarg(r,g,b) {
strR=fixxahex(r);
strG=fixxahex(g);
strB=fixxahex(b);
strFarg=strR+strR+strG+strG+strB+strB;
document.write('<span class="boxar" style="background-color: '+strFarg+'" onclick="bytFarg(r='+r+',g='+g+',b='+b+')"></span>');
}
function bytFarg(r,g,b) {
strR=fixxahex(r);
strG=fixxahex(g);
strB=fixxahex(b);
strFarg=strR+strR+strG+strG+strB+strB;
farg.style.backgroundColor='#' + strFarg;
document.colorForm.visaColor.value=strFarg;
}
</script>
</head>
<body>
<table bgcolor="black" align="center">
<form name="colorForm">
<tr>
<td>
<script>
var i,x,y;
for (i=0; i<16; i+=3) {
for (x=0; x<16; x+=3) {
for (y=0; y<16; y+=3) {
skrivFarg(i,x,y);
}
}
document.write('\n<br>\n');
}
</script>
</td>
<td valign="top">
<span id="farg" class="FargCl"></span>
<br><b><font color="#ffffff">HEX:<br>
#</font></b><input type="text" name="visaColor" value="666666" size="8">
</td>
</tr>
</form>
</table>
</body>
</html>