色彩选择条
<html>
<head>
<title>New Page 1</title>
<script language=jscript>
function insertTag(MyString)
{
bbopen='[color=' + MyString + ']'
bbclose='[/color]'
if (MM_findObj('message').createTextRange && MM_findObj('message').caretPos) {
text = bbopen + bbclose ;
var caretPos = MM_findObj('message').caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
MM_findObj('message').focus();
return;
} else {
MM_findObj('message').value += bbopen + bbclose;
MM_findObj('message').focus();
return;
}
}
var base_hexa = "0123456789ABCDEF";
function dec2Hexa(number)
{
return base_hexa.charAt(Math.floor(number / 16)) + base_hexa.charAt(number % 16);
}
function RGB2Hexa(TR,TG,TB)
{
return "#" + dec2Hexa(TR) + dec2Hexa(TG) + dec2Hexa(TB);
}
col = new Array;
col[0] = new Array(255,0,255,0,255,-1);
col[1] = new Array(255,-1,255,0,0,0);
col[2] = new Array(0,0,255,0,0,1);
col[3] = new Array(0,0,255,-1,255,0);
col[4] = new Array(0,1,0,0,255,0);
col[5] = new Array(255,0,0,0,255,-1);
col[6] = new Array(255,-1,0,0,0,0);
function rgb(pas,w,h,text1,text2){
for (j=0;j<6+1;j++){
for (i=0;i<pas+1;i++)
{
r = Math.floor(col[j][0]+col[j][1]*i*(255)/pas);
g = Math.floor(col[j][2]+col[j][3]*i*(255)/pas);
b = Math.floor(col[j][4]+col[j][5]*i*(255)/pas);
codehex = r + '' + g + '' + b;
document.write('<td bgColor=\"' + RGB2Hexa(r,g,b) + '\" onClick=\"insertTag(this.bgColor);lightCase(this);\" onmouseover=\"lightCase1(this);\" title=\"'+text1+ RGB2Hexa(r,g,b) + ']'+text2+'color]\" width=\"'+w+'\" height=\"'+h+'\"><IMG height='+h+' src="images/spacer.gif" width='+w+' border=0></TD>\n');
}}}</script>
</head>
<body>
<SCRIPT language=JavaScript>
var height1 = 10;//define the height of the color bar
var pas = 28;// define the number of color in the color bar
var width1=Math.floor(-2/15*pas+6);//define the width of the color bar here (for forum with little width put 1)
</SCRIPT>
<TABLE id=ColorPanel cellSpacing=0 cellPadding=0 align=left
border=0>
<TBODY>
<TR>
<TD id=ColorUsed
onclick="if(this.bgColor.length > 0) insertTag(this.bgColor)"
vAlign=center align=middle BORDER-RIGHT: BORDER-TOP:
BORDER-LEFT: ridge; CURSOR: default; BORDER-BOTTOM: 2px
ridge?>
<SCRIPT language=JavaScript>
document.write('<IMG height='+height1+' src="images/spacer.gif" width=10 border=1></TD>');</SCRIPT>
<TD width=5>
<SCRIPT language=JavaScript>
document.write('<IMG height='+height1+' src="images/spacer.gif" width=5 border=0></TD>');</SCRIPT>
<TD id=ColorUsed1
onclick="if(this.bgColor.length > 0) insertTag(this.bgColor)"
vAlign=center align=middle BORDER-RIGHT: BORDER-TOP:
BORDER-LEFT: ridge; CURSOR: default; BORDER-BOTTOM: 2px
ridge?>
<SCRIPT language=JavaScript>
document.write('<IMG height='+height1+' src="images/spacer.gif" width=10 border=1></TD>');</SCRIPT>
<TD width=5>
<SCRIPT language=JavaScript>
document.write('<IMG height='+height1+' src="images/spacer.gif" width=5 border=0></TD>');</SCRIPT>
<SCRIPT language=JavaScript>
<!--
rgb(pas,width1,height1)
// -->
</SCRIPT>
</TD></TR></TBODY></TABLE>
</body>
</html>