El code del generador
Código PHP:
<table border="0" cellpadding="5" cellspacing="0" class="pagebody">
<tr><td valign="top" class="side">
</td><td valign="top" class="main">
<form name="fader" action="JavaScript:calccol();">
<table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="50%" align="right"><b>Colour 1</b></td>
<td width="50%">#<input type="text" name="color1" size="7" value="000000"></td>
</tr>
<tr>
<td width="50%" align="right"><b>Colour 2</b></td>
<td width="50%">#<input type="text" name="color2" size="7" value="FFFFFF"></td>
</tr>
<tr>
<td width="50%" align="right"><b>Steps</b></td>
<td width="50%"><input type="text" name="nosteps" size="4" value="10"></td>
</tr>
<tr><td colspan="2"><input type="submit" value="Generate Fade Array" name="B1"></td></tr>
</table>
<p><b><font size="4"><span id="testtext">THIS IS TEST TEXT</span></font></b></p>
<p align="center">
<textarea rows="4" name="output" cols="74" class="codeexample" onclick="this.select();" readonly>Fade Array Will Appear Here</textarea>
</p>
</form>
</blockquote>
</td></tr>
</table>
</center>
</div>
<script language="JavaScript">
var updown = 1; var ud = 1; var he = "0123456789abcdef"; var c = he.split('');
var colour = new Array();
var upanddown;
function calccol(){
colour = new Array();
clearTimeout(upanddown);
var c1 = document.fader.color1.value.toLowerCase().split('');
var c2 = document.fader.color2.value.toLowerCase().split('');
var steps = document.fader.nosteps.value-1;
colour[0] = document.fader.color1.value.toUpperCase();
for (n=1; n<steps;n++){
var red = ((he.indexOf(c1[0])*16)+he.indexOf(c1[1]))+(n*(((he.indexOf(c2[0])*16)+he.indexOf(c2[1]))-((he.indexOf(c1[0])*16)+he.indexOf(c1[1])))/steps);
var green = ((he.indexOf(c1[2])*16)+he.indexOf(c1[3]))+(n*(((he.indexOf(c2[2])*16)+he.indexOf(c2[3]))-((he.indexOf(c1[2])*16)+he.indexOf(c1[3])))/steps);
var blue = ((he.indexOf(c1[4])*16)+he.indexOf(c1[5]))+(n*(((he.indexOf(c2[4])*16)+he.indexOf(c2[5]))-((he.indexOf(c1[4])*16)+he.indexOf(c1[5])))/steps);
colour[n] = String(c[parseInt(red/16)]+c[parseInt(red-(parseInt(red/16)*16))]+c[parseInt(green/16)]+c[parseInt(green-(parseInt(green/16)*16))]+c[parseInt(blue/16)]+c[parseInt(blue-(parseInt(blue/16)*16))]).toUpperCase();
}
colour[colour.length] = document.fader.color2.value.toUpperCase();
document.fader.output.value="";
for (n=0;n<colour.length;n++){
document.fader.output.value+='"#'+colour[n]+'"';
if(n<colour.length-1) document.fader.output.value+=', ';
}
upd();
}
function upd(){
updown += ud;
document.all['testtext'].style.color = '#'+colour[updown];
if ((updown >= colour.length-1)||(updown < 1)){
var tud = 0-ud;
ud = tud;
}
upanddown = setTimeout("upd()",50);
}
</script>