printf (" #%2.2X%2.2X%2.2X\n",$red,$green,$blue);
$img->ReadImage('xc:White');
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
use Image::Magick; my $DEBUG = 1; # Dateiname my $name = 'z'; # Hellgrün in RGB my ($red,$green,$blue) = (0,255,0); my $color_hex = sprintf "#%02X%02X%02X",$red,$green,$blue; warn $color_hex if $DEBUG; # Objekt für Bilder erzeugen my $img = Image::Magick->new(); # Bildgröße setzen $img->Set(size=>'30x20', fill => 'white'); # Bild mit Farbe erzeugen $img->ReadImage("xc:$color_hex"); $name = $name."_" if ($name ne ''); my $warn = $img->Write($name.$red."_".$green."_".$blue.".gif"); die $warn if $warn;