- or download this
my %color = ( lavender => $im->colorAllocate(230,230,255),
lightblue => $im->colorAllocate(173,216,230),
...
while (@ary) {
my $genecolor= coloring ();
$im->filledRectangle($X1,$Y1-20,$X2,$Y2,$color{$genecolor});
- or download this
sub coloring{
my @color= @{$_[0]};
my $color_no=int(rand(scalar @color));
return $color[$color_no];
}
- or download this
my %color = ( lavender => $im->colorAllocate(230,230,255),
lightblue => $im->colorAllocate(173,216,230),
...
my $genecolor= coloring ([keys %color]);
$im->filledRectangle($X1,$Y1-20,$X2,$Y2,$color{$genecolor});
}