

<style type=text/css>TD {
	FONT-SIZE: 10.8pt
}
BODY {
	FONT-SIZE: 10.8pt
}
BUTTON {
	WIDTH: 5em
}
</style>
<!-- #include virtual="/lrgw/inc/css.asp" -->
<script language=JavaScript>
var SelRGB = '000000';
var DrRGB = '';
var SelGRAY = '120';

var hexch = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');

function ToHex(n)
{	var h, l;

	n = Math.round(n);
	l = n % 16;
	h = Math.floor((n / 16)) % 16;
	return (hexch[h] + hexch[l]);
}

function DoColor(c, l)
{ var r, g, b;

  r = '0x' + c.substring(1, 3);
  g = '0x' + c.substring(3, 5);
  b = '0x' + c.substring(5, 7);
  
  if(l > 120)
  {
    l = l - 120;

    r = (r * (120 - l) + 255 * l) / 120;
    g = (g * (120 - l) + 255 * l) / 120;
    b = (b * (120 - l) + 255 * l) / 120;
  }else
  {
    r = (r * l) / 120;
    g = (g * l) / 120;
    b = (b * l) / 120;
  }

  return '#' + ToHex(r) + ToHex(g) + ToHex(b);
}

function EndColor()
{ var i;

  if(DrRGB != SelRGB)
  {
    DrRGB = SelRGB;
    for(i = 0; i <= 30; i ++)
      GrayTable.rows(i).bgColor = DoColor(SelRGB, 240 - i * 8);
  }

  SelColor.value = DoColor(RGB.innerText, GRAY.innerText);
  ShowColor.bgColor = SelColor.value;
}
</script>

<script language=JavaScript event=onclick for=ColorTable>
  SelRGB = event.srcElement.bgColor;
  EndColor();
</script>

<script language=JavaScript event=onmouseover for=ColorTable>
  RGB.innerText = event.srcElement.bgColor;
  EndColor();
</script>

<script language=JavaScript event=onmouseout for=ColorTable>
  RGB.innerText = SelRGB;
  EndColor();
</script>

<script language=JavaScript event=onclick for=GrayTable>
  SelGRAY = event.srcElement.title;
  EndColor();
</script>

<script language=JavaScript event=onmouseover for=GrayTable>
  GRAY.innerText = event.srcElement.title;
  EndColor();
</script>

<script language=JavaScript event=onmouseout for=GrayTable>
  GRAY.innerText = SelGRAY;
  EndColor();
</script>

<script language=JavaScript event=onclick for=Ok>
  window.returnValue = SelColor.value;
  window.close();
</script>

<body   bgcolor=menu topmargin="10" leftmargin="13" marginwidth="0" marginheight="0" >
<table cellspacing=0 cellpadding=0 border=0 align="center" width="260">
  <tr width=5><td></td></tr>
  <tr>
    <td>
      <table id=ColorTable style="CURSOR: hand" cellspacing=0 cellpadding=0 
      border=0>
        <script language=JavaScript>
function wc(r, g, b, n)
{
	r = ((r * 16 + r) * 3 * (15 - n) + 0x80 * n) / 15;
	g = ((g * 16 + g) * 3 * (15 - n) + 0x80 * n) / 15;
	b = ((b * 16 + b) * 3 * (15 - n) + 0x80 * n) / 15;

	document.write('<TD BGCOLOR=#' + ToHex(r) + ToHex(g) + ToHex(b) + ' height=10 width=10></TD>');
}

var cnum = new Array(1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0);

  for(i = 0; i < 16; i ++)
  {
     document.write('<TR>');
     for(j = 0; j < 30; j ++)
     {
     	n1 = j % 5;
     	n2 = Math.floor(j / 5) * 3;
     	n3 = n2 + 3;

     	wc((cnum[n3] * n1 + cnum[n2] * (5 - n1)),
     		(cnum[n3 + 1] * n1 + cnum[n2 + 1] * (5 - n1)),
     		(cnum[n3 + 2] * n1 + cnum[n2 + 2] * (5 - n1)), i);
     }

     document.writeln('</TR>');
  }
</script>

        </table></td>
		<td width=10></td>
    <td>
      <table id=GrayTable style="CURSOR: hand" cellspacing=0 cellpadding=0 
      border=0 height=100% bgcolor="#00FF99">
        <script language=JavaScript>
  for(i = 255; i >= 0; i -= 8.5)
     document.write('<TR BGCOLOR=#' + ToHex(i) + ToHex(i) + ToHex(i) + '><TD TITLE=' + Math.floor(i * 16 / 17) + '  width=20></TD></TR>');
</script>

        </table></td></tr>
  </table>

<hr width="260">
    
<table cellspacing=1 cellpadding=0 border=0 width="260" height="49" align="center" class=vtext>
  <tbody> 
  <tr> 
    <td align=middle width="87" rowspan="2">选中色彩 
      <table id=ShowColor height=30 cellspacing=0 cellpadding=0 width=59 
      border=1>
        <tbody> 
        <tr> 
          <td></td>
        </tr>
        </tbody> 
      </table>
    </td>
    <td rowspan="2" valign="top">基色: <span id=RGB></span><br>
      亮度: <span 
      id=GRAY>120</span><br>
      代码: 
      <input id=SelColor size=7>
    </td>
    <td height="20" align="center" valign="middle" width="58"> 
      <input  id=Ok type=submit value=" 确定 " name="submit" >
    </td>
  </tr>
  <tr> 
    <td height="23" align="center" width="58" valign="middle"> 
      <input type=BUTTON onClick=window.close(); value=" 取消 " name="BUTTON">
    </td>
  </tr>
  </tbody> 
</table>
 
</body>
