.\" 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::Color 3pm" .TH Color::Library::Color 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::Color \- Color entry for a Color::Library color dictionary .SH "METHODS" .IX Header "METHODS" .ie n .IP "$id = $color\->id" 4 .el .IP "\f(CW$id\fR = \f(CW$color\fR\->id" 4 .IX Item "$id = $color->id" Returns the id of the color .Sp A color id is in the format of , e.g. .Sp .Vb 4 \& svg:aliceblue \& x11:bisque2 \& nbs\-iscc\-f:chromeyellow.66 \& vaccc:darkspringyellow .Ve .ie n .IP "$name = $color\->name" 4 .el .IP "\f(CW$name\fR = \f(CW$color\fR\->name" 4 .IX Item "$name = $color->name" Returns the name of the color, e.g. .Sp .Vb 4 \& aliceblue \& bisque2 \& chromeyellow \& darkspringyellow .Ve .ie n .IP "$title = $color\->title" 4 .el .IP "\f(CW$title\fR = \f(CW$color\fR\->title" 4 .IX Item "$title = $color->title" Returns the title of the color, e.g. .Sp .Vb 4 \& aliceblue \& bisque2 \& chrome yellow \& Dark Spring\-Yellow .Ve .ie n .IP "$dictionary = $color\->dictionary" 4 .el .IP "\f(CW$dictionary\fR = \f(CW$color\fR\->dictionary" 4 .IX Item "$dictionary = $color->dictionary" Returns the Color::Library::Dictionary object that the color belongs to .ie n .IP "$hex = $color\->hex" 4 .el .IP "\f(CW$hex\fR = \f(CW$color\fR\->hex" 4 .IX Item "$hex = $color->hex" Returns the hex value of the color, e.g. .Sp .Vb 4 \& ff08ff \& eed5b7 \& eaa221 \& 669900 .Ve .Sp Note that \f(CW$hex\fR does \s-1NOT\s0 include the leading #, for that use \f(CW$color\fR\->html, \f(CW$color\fR\->css, or \f(CW$color\fR\->svg .ie n .IP "$html = $color\->html" 4 .el .IP "\f(CW$html\fR = \f(CW$color\fR\->html" 4 .IX Item "$html = $color->html" .PD 0 .ie n .IP "$css = $color\->css" 4 .el .IP "\f(CW$css\fR = \f(CW$color\fR\->css" 4 .IX Item "$css = $color->css" .ie n .IP "$svg = $color\->svg" 4 .el .IP "\f(CW$svg\fR = \f(CW$color\fR\->svg" 4 .IX Item "$svg = $color->svg" .PD Returns the hex value of the color with a leading #, suitable for use in \s-1HTML, CSS,\s0 or \s-1SVG\s0 documents, e.g. .Sp .Vb 4 \& #ff08ff \& #eed5b7 \& #eaa221 \& #669900 .Ve .ie n .IP "$value = $color\->value" 4 .el .IP "\f(CW$value\fR = \f(CW$color\fR\->value" 4 .IX Item "$value = $color->value" Returns the numeric value of the color, e.g. .Sp .Vb 4 \& 15792383 \& 15652279 \& 15376929 \& 6723840 .Ve .ie n .IP "($r, $g, $b) = $color\->rgb" 4 .el .IP "($r, \f(CW$g\fR, \f(CW$b\fR) = \f(CW$color\fR\->rgb" 4 .IX Item "($r, $g, $b) = $color->rgb" Returns r, g, and b values of the color as a 3 element list (list context), e.g. .Sp .Vb 1 \& (240, 248, 255) .Ve .ie n .IP "$rgb = $color\->rgb" 4 .el .IP "\f(CW$rgb\fR = \f(CW$color\fR\->rgb" 4 .IX Item "$rgb = $color->rgb" Returns r, g, and b values of the color in a 3 element array (scalar context), e.g. .Sp .Vb 1 \& [ 240, 248, 255 ] .Ve .ie n .IP "$color = Color::Library::Color\->new( id => $id, name => $name, title => $title, value => $value )" 4 .el .IP "\f(CW$color\fR = Color::Library::Color\->new( id => \f(CW$id\fR, name => \f(CW$name\fR, title => \f(CW$title\fR, value => \f(CW$value\fR )" 4 .IX Item "$color = Color::Library::Color->new( id => $id, name => $name, title => $title, value => $value )" .PD 0 .ie n .IP "$color = Color::Library::Color\->new( { id => $id, name => $name, title => $title, value => $value } )" 4 .el .IP "\f(CW$color\fR = Color::Library::Color\->new( { id => \f(CW$id\fR, name => \f(CW$name\fR, title => \f(CW$title\fR, value => \f(CW$value\fR } )" 4 .IX Item "$color = Color::Library::Color->new( { id => $id, name => $name, title => $title, value => $value } )" .ie n .IP "$color = Color::Library::Color\->new( [[ $id, $name, $title, $rgb, $hex, $value ]] )" 4 .el .IP "\f(CW$color\fR = Color::Library::Color\->new( [[ \f(CW$id\fR, \f(CW$name\fR, \f(CW$title\fR, \f(CW$rgb\fR, \f(CW$hex\fR, \f(CW$value\fR ]] )" 4 .IX Item "$color = Color::Library::Color->new( [[ $id, $name, $title, $rgb, $hex, $value ]] )" .PD Returns a new Color::Library::Color object representing the specified color .Sp You probably don't want/need to call this yourself .SS "\s-1FUNCTIONS\s0" .IX Subsection "FUNCTIONS" .ie n .IP "$hex = Color::Library::Color::rgb2hex( $rgb )" 4 .el .IP "\f(CW$hex\fR = Color::Library::Color::rgb2hex( \f(CW$rgb\fR )" 4 .IX Item "$hex = Color::Library::Color::rgb2hex( $rgb )" .PD 0 .ie n .IP "$hex = Color::Library::Color::rgb2hex( $r, $g, $b )" 4 .el .IP "\f(CW$hex\fR = Color::Library::Color::rgb2hex( \f(CW$r\fR, \f(CW$g\fR, \f(CW$b\fR )" 4 .IX Item "$hex = Color::Library::Color::rgb2hex( $r, $g, $b )" .PD Converts an rgb value to its hex representation .ie n .IP "$value = Color::Library::Color::rgb2value( $rgb )" 4 .el .IP "\f(CW$value\fR = Color::Library::Color::rgb2value( \f(CW$rgb\fR )" 4 .IX Item "$value = Color::Library::Color::rgb2value( $rgb )" .PD 0 .ie n .IP "$value = Color::Library::Color::rgb2value( $r, $g, $b )" 4 .el .IP "\f(CW$value\fR = Color::Library::Color::rgb2value( \f(CW$r\fR, \f(CW$g\fR, \f(CW$b\fR )" 4 .IX Item "$value = Color::Library::Color::rgb2value( $r, $g, $b )" .PD Converts an rgb value to its numeric representation .ie n .IP "$rgb = Color::Library::Color::value2rgb( $value )" 4 .el .IP "\f(CW$rgb\fR = Color::Library::Color::value2rgb( \f(CW$value\fR )" 4 .IX Item "$rgb = Color::Library::Color::value2rgb( $value )" .PD 0 .ie n .IP "($r, $g, $b) = Color::Library::Color::value2rgb( $value )" 4 .el .IP "($r, \f(CW$g\fR, \f(CW$b\fR) = Color::Library::Color::value2rgb( \f(CW$value\fR )" 4 .IX Item "($r, $g, $b) = Color::Library::Color::value2rgb( $value )" .PD Converts a numeric color value to its rgb representation .ie n .IP "($r, $g, $b) = Color::Library::Color::parse_rgb_color( $hex )" 4 .el .IP "($r, \f(CW$g\fR, \f(CW$b\fR) = Color::Library::Color::parse_rgb_color( \f(CW$hex\fR )" 4 .IX Item "($r, $g, $b) = Color::Library::Color::parse_rgb_color( $hex )" .PD 0 .ie n .IP "($r, $g, $b) = Color::Library::Color::parse_rgb_color( $value )" 4 .el .IP "($r, \f(CW$g\fR, \f(CW$b\fR) = Color::Library::Color::parse_rgb_color( \f(CW$value\fR )" 4 .IX Item "($r, $g, $b) = Color::Library::Color::parse_rgb_color( $value )" .PD Makes a best effort to convert a hex or numeric color value to its rgb representation