sub define_color { my $this = shift; my $name = shift; my ($r, $g, $b) = @_; return unless $r < 1000; return unless $g < 1000; return unless $b < 1000; return unless $r > 0; return unless $g > 0; return unless $b > 0; init_color($this->{ccount}, $r, $g, $b); $this->{cmap}->{$name} = $this->{ccount}; $this->{ccount}++; return 1; }