package GD::Graph::Thermometer; use warnings; use strict; use Carp; use GD; use GD::Text::Align; use Data::Dumper; use constant PI => 3.14; sub new { my $self = shift; my $args = shift; . . . my $image = new GD::Image($args->{width},$args->{height}); my $colors = $self->_define_colors($image, { background_color => $args->{'background_color'}, outline_color => $args->{'outline_color'}, text_color => $args->{'text_color'}, mercury_color => $args->{'mercury_color'} }); . . . return; } sub _define_colors { my $self = shift; my $image = shift; my $custom_colors = shift; print STDERR Dumper($self,$image,$custom_colors); . . . my $text_color; if (defined($custom_colors->{text_color})) { $text_color = $image->colorAllocate($custom_colors->{text_color}); } else { $text_color = $self->_black($image); } . . . return $colors; }