in reply to Re^2: color problem
in thread color problem

Instead of drawing $red and then drawing $green, you need to find out which of the two is in the back, and draw that one first.

For example, do it like this:

# Define the two planets my @large= ($red, 200,200,50,50 ); my @small= ($green, $xc, $yc, 25, 25 ); my( $front, $back ); if( $red_is_in_front_of_green ) { $front= \@large; $back= \@small; } else { $front= \@small; $back= \@large; }; # Just in case we ever go beyond two objects my @objects_to_draw= ($back, $front); for my $item (@objects_to_draw) { my( $color, @position )= @$item; $ima->filledEllipse( @position, $color ); };

Replies are listed 'Best First'.
Re^4: color problem
by Anonymous Monk on Dec 29, 2013 at 19:05 UTC

    Thank you.