Acme::Orange - Like Acme::Colour but only for important colours


Acme-Orange documentation Contained in the Acme-Orange distribution.

Index


Code Index:

NAME

Top

Acme::Orange - Like Acme::Colour but only for important colours

SYNOPSIS

Top

  $c = Acme::Orange->new();
  $colour = $c->colour; # orange
  $c->add("orange");    # $c->colour still orange
  $c->add("blue");      # $c->colour still orange.

  $c = Acme::Orange->new("pink");
  $colour = $c->colour; # orange.

ABSTRACT

Top

The Acme::Orange module provides the same interface as Acme::Colour, but restricts itself to important colours

DESCRIPTION

Top

Methods are as Acme::Colour

SEE ALSO

Top

Acme::Colour by Leon Brocard

Acme::Tango by Peter Sergeant

BUGS

Top

Can't do overloaded constants. Yet

AUTHOR

Top

Nicholas Clark, <nick@talking.bollo.cx>

COPYRIGHT AND LICENSE

Top


Acme-Orange documentation Contained in the Acme-Orange distribution.

package Acme::Orange;
use Acme::Colour;

use 5.004;
use strict;

require Exporter;
use vars qw($VERSION @ISA);
@ISA = 'Acme::Colour';

$VERSION = '0.03';

sub default {
  return 'orange';
}

sub new {
  my $class = shift;
  my $colour = shift;
  if (defined $colour) {
    undef $colour unless $colour =~ /orange/i;
  }
  # I can't remember if there is a better way to do this with SUPER::
  # Patches welcome...
  Acme::Colour::new ($class, $colour, @_);
}

sub closest {
  return 'orange';
}

*_closest = \*closest;

__END__