LaTeXM...:Color(3pm)
✨ NAME ✨
Okay so this is the LaTeXM...:Color(3pm) page, and the main character is LaTeXML::Common::Color — an abstract class representating colors using various color models; it extends LaTeXML::Common::Object. 💅
🎁 Exported functions 🎁
$color = Color($model,@components);— creates a Color object using the color model you pass in and the components you give it. The core color models arergb,hsv,cmy,cmykandgray. For colors using those core models, the components are between0and1(inclusive) — yes, both ends count, bestie. 💖Black,White— constant color objects representing black and white, respectively. Literally the main-character constants. 🖤🤍
🛠️ Methods 🛠️
$model = $color->model;— returns the name of the color model. Lowkey iconic.@components = $color->components;— returns the components of the color. All of them. 💅$other = $color->convert($tomodel);— converts the color to another color model. Glow-up complete. ✨$string = $color->toString;— returns a printed representation of the color.$hex = $color->toHex;— returns a string representing the color as RGB in hexadecimal, six digits. Six. Periodt. 🎀$other = $color->toCore();— converts the color to one of the core colors.$complement = $color->complement();— returns the complement color. This one works for colors in thergb,cmyandgraycolor models. 🎨$new = $color->mix($other,$fraction);— returns a new color that results from mixing a$fractionof$colorwith(1-$fraction)of color$other. Math but make it fashion. 🧮$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 multiplying the components by$n. Yes, the signature says$mand the description says$n— that’s the original’s little lore drop, not mine. 💀$new = $color->multiply(@m);— returns a new color made by multiplying the components by the corresponding component from@n. Again: signature@m, description@n. I’m just reporting the group chat. 🙈
👀 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.
💌 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.
💖 That’s the whole page, bestie — sourced from perl v5.40.1, dated 2025-11-16, and filed under LaTeXM...:Color(3pm). Periodt. 🫶✨
📦 where this page comes from
- ubuntu resolute: latexml 0.8.8-4 · PD
- ubuntu stonking: latexml 0.8.8-4 · PD
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms