foreach $feature ( @{ $features } )
{
- $cr->set_source_rgb( color_name2rgb( $feature->{ 'color' } ) );
+ $cr->set_source_rgb( @{ $feature->{ 'color' } } );
if ( $feature->{ 'type' } eq 'line' )
{
}
-sub color_name2rgb
-{
- my ( $color_name
- ) = @_;
-
- my ( %color_hash, $rgb );
-
- %color_hash = (
- 'black' => [ 0, 0, 0 ],
- 'red' => [ 255, 0, 0 ],
- 'green' => [ 0, 255, 0 ],
- 'blue' => [ 0, 0, 255 ],
- );
-
- if ( exists $color_hash{ $color_name } ) {
- $rgb = $color_hash{ $color_name };
- } else {
- $rgb = [ 0, 0, 0 ];
- }
-
- return wantarray ? @{ $rgb } : $rgb;
-}
-
-
sub file_png
{
# Martin A. Hansen, October 2009.