⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colors.html

📁 html颜色表, html颜色表, html颜色表,html颜色表
💻 HTML
字号:
<script>
function findObj(n, d){
    var p,i,x;
    if(!d)d=document;
    if((p=n.indexOf("?"))>0 && parent.frames.length){
        d=parent.frames[n.substring(p+1)].document;
        n=n.substring(0,p);
    }
    if(!(x=d[n]) && d.all)x=d.all[n];
    for(i=0; !x && i<d.forms.length; i++)x=d.forms[i][n];
    for(i=0; !x && d.layers && i<d.layers.length; i++)x=findObj(n,d.layers[i].document);
    if(!x && d.getElementById)x=d.getElementById(n);
    return x;
}
function colorsa(c){
    findObj('colordiv').style.display='none';
    //findObj('colortd').style.backgroundColor='#'+c;
    alert('#'+c); //修改此处可达到其他不同的效果
	parent.document.all.appinit.
}
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 ToHex1(n){
    var l1;
    n=Math.round(n);
    l1=n % 16;
    return (hexch[l1]+hexch[l1]);
}
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 width="8" bgcolor="#'+ToHex(r)+ToHex(g)+ToHex(b)+'" onclick="colorsa(\''+ToHex(r)+ToHex(g)+ToHex(b)+'\');" onmouseover="this.style.backgroundImage=\'url(color_bg.gif)\';" onmouseout="this.style.backgroundImage=\'\';"></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);
function colortabl(){
    for(i=0; i < 15; i ++){
        document.write('<table border="0" cellpadding="0" cellspacing="0"><tr>');
        document.write('<td bgcolor="#'+ToHex1(i)+ToHex1(i)+ToHex1(i)+'" height="8" width="8" onclick="colorsa(\''+ToHex1(i)+ToHex1(i)+ToHex1(i)+'\');" onmouseover="this.style.backgroundImage=\'url(color_bg.gif)\';" onmouseout="this.style.backgroundImage=\'\';"></td>')
        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></table>');
    }
}
</script>
<div id="colordiv" style="display:none;position:absolute;z-index:5;" onmouseout="this.style.display='none';" onmouseover="this.style.display='';">
    <script type="text/JavaScript">colortabl();</script>
</div>
<body id="colortd" onLoad="findObj('colordiv').style.display='';">
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -