I 216 colori che appariranno fedeli su qualsiasi dispositivo
- scegli il mix di colori fondamentali Red, Green e Blue
- vedi il risultato e il codice RGB corrispondente
CODICE
<script>var rgb6= Array("00", "33", "66", "99", "CC", "FF");
function cambia61()
{
for(var i=0; i < 6; i++)
{
if(document.colore61.radioR[i].checked) r=rgb6[i];
if(document.colore61.radioG[i].checked) g=rgb6[i];
if(document.colore61.radioB[i].checked) b=rgb6[i];
}
document.colore61.coloreR.style.background="#"+r+"0000";
document.colore61.coloreG.style.background="#00"+g+"00";
document.colore61.coloreB.style.background="#0000"+b;
colore="#"+r+g+b;
document.colore61.colore.style.background=colore;
document.colore61.txtColore.value=colore;
}function popola(nome){for(i=0; i < 6; i++)document.writeln("<input type='radio' name=" + nome + " onclick='cambia61()' /> " + rgb6[i] + " ");}
</script>
<form name="colore61">
<table cellspacing="0" cellpadding="3" bgcolor="silver">
<tbody>
<tr>
<td><b>RGB</b></td>
<td><input name="colore" readonly="readonly" size="30" type="text" value=" "></td>
<td><input name="txtColore" readonly="readonly" size="10" type="text" value="#000000"></td>
</tr>
<tr>
<td>Red</td>
<td><input name="coloreR" readonly="readonly" size="30" type="text" value=" "></td>
<td><script>popola("radioR");</script></td>
</tr>
<tr>
<td>Green</td>
<td><input name="coloreG" readonly="readonly" size="30" type="text" value=" "></td>
<td><script>popola("radioG");</script></td>
</tr>
<tr>
<td>Blue</td>
<td><input name="coloreB" readonly="readonly" size="30" type="text" value=" "></td>
<td><script>popola("radioB");</script></td>
</tr>
</tbody>
</table>
</form>
<script>
document.colore61.radioR[5].checked=true;
document.colore61.radioG[5].checked=true;
document.colore61.radioB[5].checked=true;
cambia61();
</script>