logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"LaTeXML::Common::Color" - abstract class representating colors using various color models; extends

Author

       Bruce Miller <bruce.miller@nist.gov>

Name

       "LaTeXML::Common::Color" - abstract class representating colors using various color models; extends
       LaTeXML::Common::Object.

   Exportedfunctions
       "$color = Color($model,@components);"
           Creates  a  Color  object using the given color model, and with the given components.  The core color
           models are "rgb", "hsv", "cmy", "cmyk" and "gray".  The components of colors using core color  models
           are between 0 and 1 (inclusive)

       "Black", "White"
           Constant color objects representing black and white, respectively.

   Methods
       "$model = $color->model;"
           Return the name of the color model.

       "@components = $color->components;"
           Return 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 (works for colors in "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.

       "$new = $color->multiply(@m);"
           Returns a new color made by mulitiplying the components by the corresponding component from @n.

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.

See Also