|
Really.
Then
please
interpret
this
for
me:
|
|
|
|
|
hexarray = new Array(16);
hexarray[0] = "0"; hexarray[1] = "1"; hexarray[2] = "2"; hexarray[3] = "3"; hexarray[4] = "4"; hexarray[5] = "5"; hexarray[6] = "6"; hexarray[7] = "7"; hexarray[8] = "8"; hexarray[9] = "9"; hexarray[10] = "A"; hexarray[11] = "B"; hexarray[12] = "C"; hexarray[13] = "D"; hexarray[14] = "E"; hexarray[15] = "F";
function DecToHex(x)
{
var high = x / 16;
var s = high+"";
s = s.substring(0, 2);
high = parseInt(s, 10);
var left = hexarray[high];
var low = x - high * 16;
s = low + "";
s = s.substring(0, 2);
low = parseInt(s, 10);
var right = hexarray[low];
var string = left + "" + right;
return string;
}
function HexToDec(y)
{
ysub1 = y.substring(0, 1);
for (var j = 0; j < 17; j++)
{
if (ysub1 == hexarray[j])
{
left = j;
}
}
ysub2 = y.substring(1, 2);
for (var j = 0; j < 16; j++)
{
if (ysub2 == hexarray[j])
{
right = j;
}
}
var string = left * 16 + right;
return string;
}
function MakeColouredName(text,colour1,colour2,writelastthrough)
{
colour1_r = HexToDec(colour1.substring(0, 2));
colour1_g = HexToDec(colour1.substring(2, 4));
colour1_b = HexToDec(colour1.substring(4 ,6));
colour2_r = HexToDec(colour2.substring(0, 2));
colour2_g = HexToDec(colour2.substring(2, 4));
colour2_b = HexToDec(colour2.substring(4, 6));
if (colour1_r == colour2_r){difference_r = 0; stepping_r = 0;} else {difference_r = colour1_r - colour2_r; stepping_r = difference_r / text.length-1;}
if (colour1_g == colour2_g){difference_g = 0; stepping_g = 0;} else {difference_g = colour1_g - colour2_g; stepping_g = difference_g / text.length-1;}
if (colour1_b == colour2_b){difference_b = 0; stepping_b = 0;} else {difference_b = colour1_b - colour2_b; stepping_b = difference_b / text.length-1;}
for(var i = 0; i < text.length; i++)
{
decpart1 = colour1_r - i * stepping_r;
decpart2 = colour1_g - i * stepping_g;
decpart3 = colour1_b - i * stepping_b;
if (decpart1 > 255) decpart1 = 255; else hexpart1 = DecToHex(decpart1);
if (decpart2 > 255) decpart1 = 255; else hexpart2 = DecToHex(decpart2);
if (decpart3 > 255) decpart1 = 255; else hexpart3 = DecToHex(decpart3);
if (writelastthrough == "yeah")
{
if (i < text.length - 1) colouredname += ""+text.substring(i, i + 1)+"";
else colouredname += ""+text.substring(i, i + 1)+"";
}
else
{
colouredname += ""+text.substring(i, i + 1)+"";
}
}
}
function DoForm(text,colour_1,colour_2,colour_3)
{
colouredname = "";
if (document.SB_colourednames.usemiddle.checked)
{
halftextlength = text.length / 2;
firsthalftext = text.substring(0, halftextlength);
secondhalftext = text.substring(halftextlength, text.length);
MakeColouredName(firsthalftext,colour_1,colour_2,'no');
MakeColouredName(secondhalftext,colour_2,colour_3,'yeah');
}
else
{
MakeColouredName(text,colour_1,colour_3,'no');
}
document.SB_colourednames.htmlcode.value = colouredname;
}
|
|
|
|
|
|
|
|
|
(VISITOR) AUTHOR'S NAME NovaFlash
MESSAGE TIMESTAMP 21 october 2005, 12:09:41
AUTHOR'S IP LOGGED 82.173.243.78
|
|
|
|