.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Color::Library 3pm" .TH Color::Library 3pm "2017-03-02" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Color::Library \- An easy\-to\-use and comprehensive named\-color library .SH "VERSION" .IX Header "VERSION" version 0.021 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Color::Library; \& \& # Search for a sea blue color \& my $seablue = Color::Library\->color("seablue"); \& \& # Search for a grey73 in the \*(Aqsvg\*(Aq and \*(Aqx11\*(Aq dictionaries only \& my $grey73 = Color::Library\->colour([qw/svg x11/] => "grey73"); \& \& # Find a bunch of colors at the same time \& my ($red, $green, $blue) = Color::Library\->colors(qw/red green blue/); \& \& # Fetch the named color "aliceblue" from the SVG dictionary \& my $color = Color::Library\->SVG\->color("aliceblue"); \& \& # Prints out "aliceblue is #ff08ff" \& print $color\->name, "is ", $color, "\en"; \& \& # Get a list of names in the svg dictionary \& my @names = Color::Library\->SVG\->names; \& \& # Get a list of colors in the x11 dictionary \& my @colors = Color::Library\->dictionary(\*(Aqx11\*(Aq)\->colors; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Color::Library is an easy-to-use and comprehensive named-color dictionary. Currently provides coverage for www (svg, html, css) colors, x11 colors, and more. .SH "DICTIONARIES" .IX Header "DICTIONARIES" The following dictionaries are available in this distribution: .PP .Vb 10 \& Color::Library::Dictionary::SVG \- Colors from the SVG specification \& Color::Library::Dictionary::X11 \- Colors for the X11 Window System (rgb.txt) \& Color::Library::Dictionary::HTML \- Colors from the HTML 4.0 specification \& Color::Library::Dictionary::IE \- Colors recognized by Internet Explorer \& Color::Library::Dictionary::Mozilla \- Colors recognized by Mozilla (ColorNames.txt) \& Color::Library::Dictionary::Netscape \- Colors recognized by Netscape \& Color::Library::Dictionary::Windows \- Colors from the Windows system palette \& Color::Library::Dictionary::VACCC \- VisiBone Anglo\-Centric Color Code \& Color::Library::Dictionary::NBS_ISCC \- Centroids of the NBS/ISCC catalog \& Color::Library::Dictionary::NBS_ISCC::A \- Dye Colors \& Color::Library::Dictionary::NBS_ISCC::B \- Colour Terminology in Biology \& Color::Library::Dictionary::NBS_ISCC::F \- Colors; (for) Ready\-Mixed Paints \& Color::Library::Dictionary::NBS_ISCC::H \- Horticultural Colour Charts \& Color::Library::Dictionary::NBS_ISCC::M \- Dictionary of Color \& Color::Library::Dictionary::NBS_ISCC::P \- Plochere Color System \& Color::Library::Dictionary::NBS_ISCC::R \- Color Standards and Color Nomenclature \& Color::Library::Dictionary::NBS_ISCC::RC \- Rock\-Color Chart \& Color::Library::Dictionary::NBS_ISCC::S \- Postage\-Stamp Color Names \& Color::Library::Dictionary::NBS_ISCC::SC \- Soil Color Charts \& Color::Library::Dictionary::NBS_ISCC::TC \- Standard Color Card of America .Ve .PP You can see a list of colors in any of these by reading their perldoc. For example: .PP .Vb 1 \& perldoc Color::Library::Dictionary::VACCC .Ve .PP If you have any suggestions for more color dictionaries to integrate, contact me. .SH "METHODS" .IX Header "METHODS" .ie n .IP "$dictionary = Color::Library\->dictionary( )" 4 .el .IP "\f(CW$dictionary\fR = Color::Library\->dictionary( )" 4 .IX Item "$dictionary = Color::Library->dictionary( )" Returns a Color::Library::Dictionary object corresponding to .ie n .IP "@dictionaries = Color::Library\->dictionaries" 4 .el .IP "\f(CW@dictionaries\fR = Color::Library\->dictionaries" 4 .IX Item "@dictionaries = Color::Library->dictionaries" .PD 0 .ie n .IP "@dictionaries = Color::Library\->dictionaries( , , ... )" 4 .el .IP "\f(CW@dictionaries\fR = Color::Library\->dictionaries( , , ... )" 4 .IX Item "@dictionaries = Color::Library->dictionaries( , , ... )" .ie n .IP "$dictionaries = Color::Library\->dictionaries( , , ... )" 4 .el .IP "\f(CW$dictionaries\fR = Color::Library\->dictionaries( , , ... )" 4 .IX Item "$dictionaries = Color::Library->dictionaries( , , ... )" .PD In list context, returns a list of Color::Library::Dictionary objects (for each passed in .Sp In scalar context, returns a hash of Color::Library::Dictionary objects mapping a dictionary id to a dictionary .Sp When called without arguments, the method will return all dictionaries .ie n .IP "$color = Color::Library\->color( )" 4 .el .IP "\f(CW$color\fR = Color::Library\->color( )" 4 .IX Item "$color = Color::Library->color( )" Returns a Color::Library::Color object found via .Sp A query can be any of the following: .RS 4 .IP "color name" 4 .IX Item "color name" A color name is like \f(CW\*(C`blue\*(C'\fR or \f(CW\*(C`bleached\-almond\*(C'\fR .IP "color title" 4 .IX Item "color title" A color title is like \f(CW\*(C`Dark Green\-Teal\*(C'\fR .IP "color id" 4 .IX Item "color id" A color id is in the form of :, for example: \f(CW\*(C`x11:azure1\*(C'\fR .RE .RS 4 .RE .IP "color( , , ... )" 4 .IX Item "color( , , ... )" In list context, returns a list of Color::Library::Color objects corresponding to each .Sp In scalar context, just returns the first .IP "color( , , ... )" 4 .IX Item "color( , , ... )" If an array reference is passed as the first argument, then this indicates that the array is a list of dictionary ids to search through (in order): .Sp .Vb 2 \& # Search in the svg and x11 dictionaries for a match \& my $blue = Color::Library\->color([qw/svg x11/], "blue"); \& \& # Will not find "aquamarine1" in the svg dictionary, so it will try the x11 dictionary \& my $aquamarine1 = Color::Library\->color([qw/svg x11/], "aquamarine1"); .Ve .ie n .IP "$color = Color::Library\->colors" 4 .el .IP "\f(CW$color\fR = Color::Library\->colors" 4 .IX Item "$color = Color::Library->colors" .PD 0 .ie n .IP "$color = Color::Library\->colour" 4 .el .IP "\f(CW$color\fR = Color::Library\->colour" 4 .IX Item "$color = Color::Library->colour" .ie n .IP "$color = Color::Library\->colours" 4 .el .IP "\f(CW$color\fR = Color::Library\->colours" 4 .IX Item "$color = Color::Library->colours" .PD All are aliases for the above color method .SH "ABOUT" .IX Header "ABOUT" This package was inspired by Graphics::ColorNames, and covers much of the same ground. However, I found the Graphics::ColorNames interface difficult to use. I also wanted to list colors directly in the perldoc, which this package does. .SH "SEE ALSO" .IX Header "SEE ALSO" Graphics::ColorNames .SH "AUTHOR" .IX Header "AUTHOR" Robert Krimen .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2011 by Robert Krimen. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.