Eine Subroutine, die einen Text mit
RGB farbig mach
RGB Colorizer
<perl>
out &bei123_colorfull("RGB Colorizer",[255,0,0],[0,0,255],36);
#############################################################################
sub bei123_colorfull
{#------------------------------------ Farbe ins Spiel bringen
my($str,$left,$right,$size)=@_;
my @step;
$step[$_] = ($right->[$_] - $left->[$_]) / (length($str) - 1) for (0 .. 2);
my @chars = split //, $str;
@chars=map{sprintf(qq(<font style="font-size:%dpx;color:#%02x%02x%02x">$chars[$_]</font>), $size, $left->[0] + $_ * $step[0], $left->[1] + $_ * $step[1], $left->[2] + $_ * $step[2])}(0 .. $#chars);
return join("", @chars);
}#
#############################################################################
</perl>