http://www.cclw.net/resources/CheckColor/CheckColor.htm
把鼠标放在图片上,就可显示出各种颜色的代码!
代码如下(以html格式保存如下代码,用浏览器打开即可查看效果):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://www.cclw.net/resources/CheckColor/CheckColor.htm -->
<HTML><HEAD><TITLE>查颜色代码</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.5921" name=GENERATOR>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<SCRIPT language=JavaScript>
<!-- annie
addary = new Array(); //
addary[0] = new Array(0,1,0); //
addary[1] = new Array(-1,0,0); //
addary[2] = new Array(0,0,1); //
addary[3] = new Array(0,-1,0); //
addary[4] = new Array(1,0,0); //
addary[5] = new Array(0,0,-1); //
addary[6] = new Array(255,1,1);
clrary = new Array(360);
for(i = 0; i < 6; i++)
for(j = 0; j < 60; j++) {
clrary[60 * i + j] = new Array(3);
for(k = 0; k < 3; k++) {
clrary[60 * i + j][k] = addary[6][k];
addary[6][k] += (addary[i][k] * 4);
}
}
function capture() {
if(document.layers) {
layobj = document.layers['wheel'];
layobj.document.captureEvents(Event.MOUSEMOVE);
layobj.document.onmousemove = moved;
}
else {
layobj = document.all["wheel"];
layobj.onmousemove = moved;
}
}
function moved(e) {
y = 4 * ((document.layers)?e.layerX:event.offsetX);
x = 4 * ((document.layers)?e.layerY:event.offsetY);
sx = x - 512;
sy = y - 512;
qx = (sx < 0)?0:1;
qy = (sy < 0)?0:1;
q = 2 * qy + qx;
quad = new Array(-180,360,180,0);
xa = Math.abs(sx);
ya = Math.abs(sy);
d = ya * 45 / xa;
if(ya > xa) d = 90 - (xa * 45 / ya);
deg = Math.floor(Math.abs(quad[q] - d));
n = 0;
sx = Math.abs(x - 512);
sy = Math.abs(y - 512);
r = Math.sqrt((sx * sx) + (sy * sy));
if(x == 512 & y == 512) {
c = "000000";
}
else {
for(i = 0; i < 3; i++) {
r2 = clrary[deg][i] * r / 256;
if(r > 256) r2 += Math.floor(r - 256);
if(r2 > 255) r2 = 255;
n = 256 * n + Math.floor(r2);
}
c = n.toString(16);
while(c.length < 6) c = "0" + c;
}
if(document.layers) {
document.layers["wheel"].document.f.t.value = "#" + c;
document.layers["wheel"].bgColor = "#" + c;
}
else {
document.all["wheel"].document.f.t.value = "#" + c;
document.all["wheel"].style.backgroundColor = "#" + c;
}
return false;
}
// annie-->
</SCRIPT>
<META content="blueprnt 011, default" name="Microsoft Theme"></HEAD>
<BODY text=#003399 vLink=#9900ff aLink=#000066 link=#3366ff bgColor=#ffffff
background="" onload=capture()><!--mstheme--><FONT face=宋体>
<DIV id=wheel
style="LEFT: 220px; VISIBILITY: visible; WIDTH: 523px; POSITION: absolute; TOP: 90px; HEIGHT: 317px">
<DIV align=center>
<CENTER><!--mstheme--></FONT>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD><!--mstheme--><FONT face=宋体><IMG height=256
src="查颜色代码.files/colorwheel.jpg" width=256 border=0>
<!--mstheme--></FONT></TD></TR>
<TR>
<TD align=middle><!--mstheme--><FONT face=宋体><BR>
<FORM name=f><INPUT size=27 name=t>
</FORM><!--mstheme--></FONT></TD></TR></TBODY></TABLE><!--mstheme--><FONT
face=宋体></CENTER></DIV></DIV>
<CENTER>
<DIV
style="FONT-SIZE: 36pt; FILTER: shadow(color= yellow, direction= 135); LEFT: 228px; WIDTH: 243px; COLOR: red; FONT-FAMILY: 夹发砰; POSITION: absolute; TOP: 18px; HEIGHT: 52px"></DIV></CENTER>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<DIV align=center>
<CENTER><!--mstheme--></FONT>
<TABLE height=55 cellSpacing=1 cellPadding=2 width="68%" border=0>
<TBODY>
<TR>
<TD align=middle width="100%" height=18><!--mstheme--><FONT
face=宋体>把鼠标放在图片上,就可显示出各种颜色的代码。<!--mstheme--></FONT></TD></TR>
<TR>
<TD align=middle width="100%" height=25><!--mstheme--><FONT face=宋体>
<P><A
href="http://www.cclw.net/resources/CheckColor/CheckColor.zip">下载</A><!--mstheme--></FONT></P></TD></TR></TBODY></TABLE><!--mstheme--><FONT
face=宋体></CENTER></DIV><!--mstheme--></FONT></BODY></HTML>