NAME

LEGO::Colors - Set of LEGO Color data

SYNOPSIS

 use LEGO::Colors;
 use strict;

 my @system_names = LEGO::Colors->get_all_system_names();

 my %color_map = LEGO::Colors->get_color_names_for_system(
         'system' => 'Peeron',
 );

 my $green = LEGO::Colors->get_color("Green");

 my $gray = LEGO::Colors->get_color(
   color    => "Light Gray",
   'system' => "BrickLink",
 );

DESCRIPTION

This is a data storage class used to maintain a list of commonly used LEGO colors and their associated RGB values. See LEGO::Color for more information.

Different online sources of LEGO information use slightly different names for LEGO colors. I have chose a set of names to consider the "default", and those names are used in this module as the default color names. A color name aliasing system is available for access to names from other sources. Please see the SYSTEMS section of the documentation for more information.

All color and system names are case and whitespace INsensitive. That is, "Dark Red", "darkred" and "dA RkrE d" are all considered the same.

METHODS

get_all_system_names

Returns a list of all known color naming system names. Takes no arguments.

get_color_names_for_system

Returns a hash mapping default color names to their equivalent color names in the provided system. Takes one named argument, "system", which is optional. If omitted, default color names will be mapped to themselves, otherwise they will be mapped to the color names from the specified naming system.

get_color

Returns a LEGO::Color object representing the color named by the input arguments. Can take arguments in two forms; if a single string value is provided then it is assumed to be the color name from the default naming system. Otherwise, arguments can be passed as name => value pairs. The currently supported arguments are 'color', which is required, and 'system', which is optional and will default to the default system if not provided.

COLORS

The following colors are available, named here using the default naming system:

 Color Name         RGB Value     Pantone       CMYK Value
 ----------------------------------------------------------------------
 Black              033 033 033   Hex Black     001 001 001 100
 Blue               000 087 166   2945C         100 045 000 014
 Brown              097 048 005   732C          000 055 100 064
 Dark Blue          000 048 092   540C          100 055 000 055
 Dark Gray          112 112 097   417C          001 000 025 065
 Dark Orange        179 084 008   471C          000 059 100 018
 Dark Pink          209 097 156   674C          009 067 000 000
 Dark Red           133 054 015   1685C         000 068 100 044
 Green              000 130 074   348C          100 000 085 024
 Light Gray         163 161 153   7539C         002 000 009 036
 Light Green        061 212 133   7479C         055 000 050 000
 Light Orange       247 163 010   137C          000 035 090 000
 Light Violet       171 176 199   536C          031 020 005 000
 Light Yellow       247 214 125   134C          000 011 045 000
 Lime Green         158 171 005   383C          020 000 100 019
 Maersk Blue        092 186 204   631C          067 000 012 002
 Medium Blue        120 150 207   659C          055 030 000 000
 Orange             242 125 000   151C          000 048 095 000
 Pearl Light Gray   135 135 133   Cool Gray 9   000 001 000 051
 Purple             110 018 115   2612C         064 100 000 014
 Red                189 056 038   180C          000 079 100 011
 Sand Blue          092 120 143   5415C         042 008 000 040
 Sand Green         112 130 112   5625C         028 000 029 048
 Sand Red           153 112 089   4715C         000 042 045 034
 Tan                214 191 145   7502C         000 008 035 010
 Teal               000 138 128   3282C         100 000 046 015
 White              232 227 217   Cool Gray 1   000 000 000 006
 Yellow             247 209 023   116C          000 016 100 000
 ----------------------------------------------------------------------

The preceeding data was harvested, with permission, from the wonderful LEGO color page found at http://www.britdogmodels.com/misc/legocolors/. The color names above represent the default naming system to which all other names are relative.

SYSTEMS

Each system has a name an then a list of color name mappings, from the default name to that system's name. Cases where the names are the same will be omitted, so these lists will only contain areas of contention. All color systems contain entries for all colors.

The following alternate naming systems are available:

 System Name: Peeron

 Default Name       Peeron Name
 ----------------------------------------------------------------------
 Dark Blue          NavyBlue
 Dark Gray          DkGray
 Dark Orange        DkOrange
 Dark Pink          DkPink
 Dark Red           DkRed
 Light Gray         Gray
 Light Green        LtGreen
 Light Orange       LtOrange
 Light Violet       LtViolet
 Light Yellow       LtYellow
 Lime Green         Lime
 Medium Blue        MdBlue
 Pearl Light Gray   PearlLtGray
 ----------------------------------------------------------------------

The information above represents the color names used by the amazingly good LEGO inventory website, Peeron, at www.peeron.com. The color information was gathered from their color chart, at: http://peeron.com/inv/colors

 System Name: Bricklink

 Default Name       Bricklink Name
 ----------------------------------------------------------------------
 Lime Green         Lime
 ----------------------------------------------------------------------

The inforation above represents the color names used by the (unofficial) LEGO marketplace website, BrickLink, at www.bricklink.com. The color information was gathered from their color chart, at: http://www.bricklink.com/catalogColors.asp

If your favorite naming system is missing, or the data provided here is inaccurate or incomplete, please feel free to get in touch with me and I will make any appropriate modifications to a future release of this module. Note that it is also possible for you to make modifications to this file in your local installation and thus provide any desired color naming system.

Future Work

  • Adding more colors to both default and alternate naming systems.

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 363:

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