<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function bg_color(frm, colr_val, val) {
_val = eval("0x" + frm[colr_val].value) + val;
if (_val < 0) _val = 0;
if (_val > 255) _val = 255;
_val = _val.toString(16).toUpperCase();
while (_val.length < 2) _val = "0" + _val;
frm[colr_val].value = _val; nval = "";
for(i = 1; i < 8; i += 3) nval += frm.elements[i].value;
document.bgColor = nval;
}
//-->
</script>
</HEAD>
<BODY>
<center>
<form>
<table border=4 cellpadding=6 cellspacing=6>
<tr>
<td colspan=3 align=center bgcolor="#ff0000"><font color=white>RED</font></td>
<td colspan=3 align=center bgcolor="#00ff00">GREEN</td>
<td colspan=3 align=center bgcolor="#000ff"><font color=yellow>BLUE</font></td>
</tr>
<tr>
<td>
<input type=button name=rm value="-16" onclick = "bg_color(this.form, 'Red' , -16);">
</td>
<td>
<input type=text name=Red value="FF" size=2 maxlength=2>
</td>
<td>
<input type=button name=rp value="+16" onclick = "bg_color(this.form, 'Red', 16);">
</td>
<td>
<input type=button name=gm value="-16" onclick = "bg_color(this.form, 'Green', -16);">
</td>
<td>
<input type=text name=Green value="FF" size=2 maxlength=2>
</td>
<td>
<input type=button name=gp value="+16" onclick = "bg_color(this.form, 'Green', 16);">
</td>
<td>
<input type=button name=bm value="-16" onclick = "bg_color(this.form, 'Blue', -16);">
</td>
<td>
<input type=text name=Blue value="FF" size=2 maxlength=2>
</td>
<td>
<input type=button name=bp value="+16" onclick = "bg_color(this.form, 'Blue', 16);">
</td>
</tr>
</table>
</form>
</center>
</BODY>
</HTML>
|