$text_color = $image->colorAllocate($custom_colors->{text_color}); #### $text_color = $image->colorAllocate(@{ $custom_colors->{text_color} }); #### if( $custom_colors->{text_color} =~ m/#(..)(..)(..)/ ) { $text_color = $image->colorAllocate(map {hex($_)} ($1, $2, $3) ) }