FONT-SIZE:10.8pt
}
BODY{
FONT-SIZE:10.8pt
}
BUTTON{
WIDTH:5em
}
varSelRGB='';
varDrRGB='';
varSelGRAY='120';
varhexch=newArray('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
functionToHex(n)
{varh,l;
n=Math.round(n);
l=n%16;
h=Math.floor((n/16))%16;
return(hexch[h]+hexch[l]);
}
functionDoColor(c,l)
{varr,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);
}
functionEndColor()
{vari;
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;
}
SelRGB=event.srcElement.bgColor;
EndColor();
RGB.innerText=event.srcElement.bgColor;
EndColor();
RGB.innerText=SelRGB;
EndColor();
SelGRAY=event.srcElement.title;
EndColor();
GRAY.innerText=event.srcElement.title;
EndColor();
GRAY.innerText=SelGRAY;
EndColor();
window.returnValue=SelColor.value;
window.close();
码选择器