rEnd = "0x" + textcolor[maxColorIdx].substr(0, 2); gEnd = "0x" + textcolor[maxColorIdx].substr(2, 2); bEnd = "0x" + textcolor[maxColorIdx].substr(4, 2);
for (i=1; i<maxColorIdx; i++) { r = Math.round(((maxColorIdx-i) * parseInt(rStart) + i * parseInt(rEnd))/maxColorIdx); g = Math.round(((maxColorIdx-i) * parseInt(gStart) + i * parseInt(gEnd))/maxColorIdx); b = Math.round(((maxColorIdx-i) * parseInt(bStart) + i * parseInt(bEnd))/maxColorIdx);
r = Dec2Hex(r); g = Dec2Hex(g); b = Dec2Hex(b);
textcolor[i] = r + g + b; }
function Dec2Hex(Dec) { var hexChars = "0123456789ABCDEF"; var a = Dec % 16; var b = (Dec - a)/16; hex = "" + hexChars.charAt(b) + hexChars.charAt(a); return hex; }
for (i=0; i<=maxColorIdx; i++) { showColor(textcolor[i]); }
function showColor(color) { document.write("<div style='background: " + color + "'>" + color + "</div>"); } </script>
rEnd = Hex2Dec(textcolor[maxColorIdx].substr(0, 2)); gEnd = Hex2Dec(textcolor[maxColorIdx].substr(2, 2)); bEnd = Hex2Dec(textcolor[maxColorIdx].substr(4, 2));
for (i=1; i<maxColorIdx; i++) { r = Math.round(((maxColorIdx-i)*rStart + i*rEnd)/maxColorIdx); g = Math.round(((maxColorIdx-i)*gStart + i*gEnd)/maxColorIdx); b = Math.round(((maxColorIdx-i)*bStart + i*bEnd)/maxColorIdx);
r = Dec2Hex(r); g = Dec2Hex(g); b = Dec2Hex(b);
textcolor[i] = r + g + b; }
function Hex2Dec(Hex) { return parseInt("0x" + Hex); }
function Dec2Hex(Dec) { var hexChars = "0123456789ABCDEF"; var a = Dec % 16; var b = (Dec - a)/16; hex = "" + hexChars.charAt(b) + hexChars.charAt(a); return hex; }
for (i=0; i<=maxColorIdx; i++) { showColor(textcolor[i]); }
function showColor(color) { document.write("<div style='background: " + color + "'>" + color + "</div>"); } </script>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.