NAME

LEGO::Colors - Access to LEGO color information.

SYNOPSIS

use LEGO::Color;
use strict;

my $green = LEGO::Color->new(
  name  => 'green',
  red   => 0,
  green => 255,
  blue  => 0,
);

# Or, more likely...
my $green = LEGO::Colors->get_color('green');

DESCRIPTION

This is a simple accessor class, used to store information about various different colors that LEGO pieces can have. Generally, you won't be creating these yourself -- they're just convenient ways to pass information back from the LEGO::Colors module. Please see that documentation for more information.

METHODS

new

Constructs a new Color object. Takes 4 named parameters, all required. They are: name, red, blue and green, and hopefully self-explanatory. Returns undef if any parameters are missing or invalid.

get_name

Returns the name of this color object.

get_red

Returns the red value of this color object.

get_blue

Returns the blue value of this color object.

get_green

Returns the green value of this color object.

get_rgb

A convenience method that returns all 3 red, green and blue values in a single hashref.

get_html_code

Returns an HTML color code, of the form "#XXYYZZ" that represents the RGB values of this color object.

Future Work

  • None at this time.

Known Issues

  • None at this time.

AUTHOR

Copyright 2007 Avi Finkel <avi@finkel.org>

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)

LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software. The official LEGO website is at http://www.lego.com/

1 POD Error

The following errors were encountered while parsing the POD:

Around line 180:

Non-ASCII character seen before =encoding in 'LEGO®'. Assuming CP1252