This alias will return the text in random color per letter or random color per letter with a random color back ground per letter. Background color is optional.
Usage: $mcolor(TEXT) = text in random color ( each leter a different color )
//echo -ag $mcolor(color text test)
Usage: $mcolor(TEXT).b = text in random color with different background color ( each leter a different color )
//echo -ag $mcolor(test text color).b
Update: 17Sep08 Will not use same text color and background color.
Update: 17Sep08 Issue where using numbers caused errors has been fixed.
/*
Usage: $mcolor(TEXT) = text in random color ( each leter a different color )
//echo -ag $mcolor(color text test)
Usage: $mcolor(TEXT).b = text in random color with different background color ( each leter a different color )
//echo -ag $mcolor(test text color).b
*/
alias mcolor {
if ($isid && $1) {
var %z 1, %c
var %t $replace($1-,$chr(32),$chr(17))
while (%z <= $len($1-)) {
:retry
var %a $r(0,15), %b $r(0,15)
if (%a == %b) { goto retry }
%c = %c $+ $iif($prop == b,$+($chr(3),$iif($len(%a) = 1,$+($chr(48),%a),%a),$chr(44),$iif($len(%b) = 1,$+($chr(48),%b),%b)),$+($chr(3),$iif($len(%b) = 1,$+($chr(48),%b),%b))) $+ $mid(%t,%z,1) $+ $chr(3)
inc %z
}
return $replace(%c,$chr(17),$+($chr(3),$chr(48),$chr(44),$chr(48),$chr(32),$chr(3)))
}
}