AnnA
Случайно в курсе...
...
use GD; use GD::Text::Wrap;
my $image = new GD::Image($user_vars{\'image_x\'}, $user_vars{\'image_y\'});
# Вот здесь, как раз опеределяются цвета
my $bground = $image->colorAllocate(hex(substr($user_vars{\'bground\'},1,2)),hex(substr($user_vars{\'bground\'},3,2)),hex(substr($user_vars{\'bground\'},5,2)));
my $border = $image->colorAllocate(hex(substr($user_vars{\'border\'},1,2)),hex(substr($user_vars{\'border\'},3,2)),hex(substr($user_vars{\'border\'},5,2)));
my $textcolor = $image->colorAllocate(hex(substr($user_vars{\'textcolor\'},1,2)),hex(substr($user_vars{\'textcolor\'},3,2)),hex(substr($user_vars{\'textcolor\'},5,2)));
$image -> fill(5,5,$bground); $image -> rectangle(0,0,($user_vars{\'icon_x\'} - 1),($user_vars{\'icon_y\'} - 1),$border);
my $string = \'blablabla\';
my $text = GD::Text::Wrap -> new($image, line_space => 1, color => $textcolor, text => $string,);
$text->set_font(\'tahoma.ttf\', $user_vars{\'size\'});
$text->set(align => \'center\', width => $user_vars{\'textwidth\'});
$text->draw($user_vars{\'text_x\'},$user_vars{\'text_y\'});
my $file = \'./image.png\';
open (IMG, ">$file");
print IMG $image->png;
close IMG;
...
Надеюсь все понятно...
Практически полный набор манипуляций с текстом...
P.S. $user_vars{\'bground\'} - формат FAFAFA без решетки, в общем, определение как в HTML