blob: a9fd7f7e9c83bfba9a2848c53540419acb44c71d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
function rainbow(str)
{
str = String(str);
var c = str.length;
var rv = "";
for (var i = 0; i < c; i++)
{
var color = randomRange (2, 6);
rv += unescape ("%03" + color + str[i]);
}
return rv;
}
function fade(str)
{
var colors = new Array(1, 14, 10, 15, 0);
var cIndex = 0;
var msg = "";
for (var i = 0; i < str.length; i++)
{
msg += "%03" + colors[cIndex] + str[i];
if ((++cIndex) == 5)
{
cIndex = 0;
}
}
return unescape(msg);
}
|