<script LANGUAGE="JavaScript">
<!--
function HexArray(n)
{
this.length = n
for(i = 0; i < 10; i++)
this[i] = i
this[10] = "A"
this[11] = "B"
this[12] = "C"
this[13] = "D"
this[14] = "E"
this[15] = "F"
return(this)
}
hex = new HexArray()
function DezNachHex(x)
{
var high = Math.floor(x / 16)
var low = Math.floor(x - high * 16)
return(hex[high] + "" + hex[low])
}
function Farbspiel(text)
{
for(i = 0; i < text.length; i++)
{
FarbwertRot = 255 - (255 * i) / (text.length - 1)
FarbwertGruen = 10
FarbwertBlau = 10
document.write("<FONT face=arial size=+1 COLOR='#" + DezNachHex(FarbwertRot) + DezNachHex(FarbwertGruen) + DezNachHex(FarbwertBlau) + "'>" +
text.substring(i, i + 1) +
"</FONT>")
}
}
// -->
</script>
<script LANGUAGE="JavaScript">
<!--
Farbspiel("Hier nur ein kleines Beispiel")
//-->
</script>
Bunter Textfader<!--
function HexArray(n)
{
this.length = n
for(i = 0; i < 10; i++)
this[i] = i
this[10] = "A"
this[11] = "B"
this[12] = "C"
this[13] = "D"
this[14] = "E"
this[15] = "F"
return(this)
}
hex = new HexArray()
function DezNachHex(x)
{
var high = Math.floor(x / 16)
var low = Math.floor(x - high * 16)
return(hex[high] + "" + hex[low])
}
function Farbspiel(text)
{
for(i = 0; i < text.length; i++)
{
FarbwertRot = 255 - (255 * i) / (text.length - 1)
FarbwertGruen = 10
FarbwertBlau = 10
document.write("<FONT face=arial size=+1 COLOR='#" + DezNachHex(FarbwertRot) + DezNachHex(FarbwertGruen) + DezNachHex(FarbwertBlau) + "'>" +
text.substring(i, i + 1) +
"</FONT>")
}
}
// -->
</script>
<script LANGUAGE="JavaScript">
<!--
Farbspiel("Hier nur ein kleines Beispiel")
//-->
</script>
Hiermit kann man auf der Seiten einen Farbverlauf in einem Text erzeugen.
Es wird also jeder Buchstabe in einer anderen Farbe gezeigt.
Der Text der mit diesem Javascript bunt dargestellt wird befindet sich am ende des Scriptes..
