LaTeXML...::Color(3)

πŸ“¦ version 0.8.8, in nixos 26.05, nixpkgs unstable

🎨 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 are rgb, hsv, cmy, cmyk and gray. For colors using core color models, the components are between 0 and 1 (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 the rgb, cmy and gray color models.
  • $new = $color->mix($other,$fraction); β€” returns a new color which results from mixing a $fraction of $color with (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 $n here 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::rgb
  • LaTeXML::Common::Color::hsb
  • LaTeXML::Common::Color::cmy
  • LaTeXML::Common::Color::cmyk
  • LaTeXML::Common::Color::gray
  • LaTeXML::Common::Color::Derived

πŸ’– AUTHOR πŸ’–

Bruce Miller <bruce.miller@nist.gov> 🫢

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