LaTeXML...::Color(3)
π¨ NAME π¨
Okay bestie, meet LaTeXML::Common::Color π β it's the abstract class representating colors using various color models, and it extends LaTeXML::Common::Object. Also, for the record, this is from the User Contributed Perl Documentation and the page title is LaTeXML...::Color(3) β¨.
β¨ Exported functions β¨
$color = Color($model,@components);β creates a Color object using the given color model, with the given components. The core color models arergb,hsv,cmy,cmykandgray. For colors using core color models, the components are between0and1(inclusive) π«Ά.Black,Whiteβ constant color objects representing black and white, respectively. Iconic, honestly.
π Methods π
$model = $color->model;β returns the name of the color model.@components = $color->components;β returns the components of the color.$other = $color->convert($tomodel);β converts the color to another color model.$string = $color->toString;β returns a printed representation of the color.$hex = $color->toHex;β returns a string representing the color as RGB in hexadecimal (6 digits).$other = $color->toCore();β converts the color to one of the core colors.$complement = $color->complement();β returns the complement color; this works for colors in thergb,cmyandgraycolor models.$new = $color->mix($other,$fraction);β returns a new color which results from mixing a$fractionof$colorwith(1-$fraction)of color$other.$new = $color->add($other);β returns a new color made by adding the components of the two colors.$new = $color->scale($m);β returns a new color made by mulitiplying the components by$n(yep, the original says$nhere even though the argument is$mπ).$new = $color->multiply(@m);β returns a new color made by mulitiplying the components by the corresponding component from@n(the signature says@m, the description says@nβ keeping both exactly as written, bestie π).
π SEE ALSO π
Supported color models, spelling exactly as the page has it:
LaTeXML::Common::Color::rgbLaTeXML::Common::Color::hsbLaTeXML::Common::Color::cmyLaTeXML::Common::Color::cmykLaTeXML::Common::Color::grayLaTeXML::Common::Color::Derived
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov> π«Ά
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.
Mwah π this page is LaTeXML...::Color(3), served from perl v5.42.3 and dated 2024-02-26. Bye bestie, go paint the terminal ππ
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms