.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" 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 "LaTeXML::Common::Color 3pm" .TH LaTeXML::Common::Color 3pm "2018-08-13" "perl v5.26.2" "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" "LaTeXML::Common::Color" \- abstract class representating colors using various color models; extends LaTeXML::Common::Object. .SS "Exported functions" .IX Subsection "Exported functions" .ie n .IP """$color = Color($model,@components);""" 4 .el .IP "\f(CW$color = Color($model,@components);\fR" 4 .IX Item "$color = Color($model,@components);" Creates a Color object using the given color model, and with the given components. The core color models are \f(CW\*(C`rgb\*(C'\fR, \f(CW\*(C`hsv\*(C'\fR, \f(CW\*(C`cmy\*(C'\fR, \f(CW\*(C`cmyk\*(C'\fR and \f(CW\*(C`gray\*(C'\fR. The components of colors using core color models are between 0 and 1 (inclusive) .ie n .IP """Black"", ""White""" 4 .el .IP "\f(CWBlack\fR, \f(CWWhite\fR" 4 .IX Item "Black, White" Constant color objects representing black and white, respectively. .SS "Methods" .IX Subsection "Methods" .ie n .IP """$model = $color\->model;""" 4 .el .IP "\f(CW$model = $color\->model;\fR" 4 .IX Item "$model = $color->model;" Return the name of the color model. .ie n .IP """@components = $color\->components;""" 4 .el .IP "\f(CW@components = $color\->components;\fR" 4 .IX Item "@components = $color->components;" Return the components of the color. .ie n .IP """$other = $color\->convert($tomodel);""" 4 .el .IP "\f(CW$other = $color\->convert($tomodel);\fR" 4 .IX Item "$other = $color->convert($tomodel);" Converts the color to another color model. .ie n .IP """$string = $color\->toString;""" 4 .el .IP "\f(CW$string = $color\->toString;\fR" 4 .IX Item "$string = $color->toString;" Returns a printed representation of the color. .ie n .IP """$hex = $color\->toHex;""" 4 .el .IP "\f(CW$hex = $color\->toHex;\fR" 4 .IX Item "$hex = $color->toHex;" Returns a string representing the color as \s-1RGB\s0 in hexadecimal (6 digits). .ie n .IP """$other = $color\->toCore();""" 4 .el .IP "\f(CW$other = $color\->toCore();\fR" 4 .IX Item "$other = $color->toCore();" Converts the color to one of the core colors. .ie n .IP """$complement = $color\->complement();""" 4 .el .IP "\f(CW$complement = $color\->complement();\fR" 4 .IX Item "$complement = $color->complement();" Returns the complement color (works for colors in \f(CW\*(C`rgb\*(C'\fR, \f(CW\*(C`cmy\*(C'\fR and \f(CW\*(C`gray\*(C'\fR color models). .ie n .IP """$new = $color\->mix($other,$fraction);""" 4 .el .IP "\f(CW$new = $color\->mix($other,$fraction);\fR" 4 .IX Item "$new = $color->mix($other,$fraction);" Returns a new color which results from mixing a \f(CW$fraction\fR of \f(CW$color\fR with \f(CW\*(C`(1\-$fraction)\*(C'\fR of color \f(CW$other\fR. .ie n .IP """$new = $color\->add($other);""" 4 .el .IP "\f(CW$new = $color\->add($other);\fR" 4 .IX Item "$new = $color->add($other);" Returns a new color made by adding the components of the two colors. .ie n .IP """$new = $color\->scale($m);""" 4 .el .IP "\f(CW$new = $color\->scale($m);\fR" 4 .IX Item "$new = $color->scale($m);" Returns a new color made by mulitiplying the components by \f(CW$n\fR. .ie n .IP """$new = $color\->multiply(@m);""" 4 .el .IP "\f(CW$new = $color\->multiply(@m);\fR" 4 .IX Item "$new = $color->multiply(@m);" Returns a new color made by mulitiplying the components by the corresponding component from \f(CW@n\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Supported color models: LaTeXML::Common::Color::rgb, LaTeXML::Common::Color::hsb, LaTeXML::Common::Color::cmy, LaTeXML::Common::Color::cmyk, LaTeXML::Common::Color::gray and LaTeXML::Common::Color::Derived. .SH "AUTHOR" .IX Header "AUTHOR" Bruce Miller .SH "COPYRIGHT" .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the \s-1US.\s0