brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
957 stars 101 forks source link

avoid using grayscale base when mixing richer colors #2408

Closed dginev closed 2 months ago

dginev commented 2 months ago

Fixes #2407

The problem was that when a base model is grayscale, a mix operation with rgb would remain in the base model - i.e. remain in grayscale. So when mix or add executes, the "richer" color model ought to be used.

Suggestions welcome if my code should be structured better, I almost made a new sub to hold the model-switching logic. Are there more places that could benefit from this treatment?