brucemiller / LaTeXML

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

Color Mixing Desaturates Result #2407

Closed Xaldew closed 2 months ago

Xaldew commented 3 months ago

There seem to be a bit of a bug when using colorlet or definecolor to mix or lighten the colors used in e.g., colorboxes, e.g., in this example white is mixed with 70% of some other colors:

\documentclass[acmsmall,screen]{acmart}

\definecolor{BaseOmm2Transparent}{HTML}{FA9005}
\definecolor{BaseOmm2Opaque}{HTML}{056FFA}

\definecolor{BaseOmm4Transparent}{HTML}{FF0000}
\definecolor{BaseOmm4Opaque}{HTML}{00FF00}
\definecolor{BaseOmm4UnknownTransparent}{HTML}{EDE945}
\definecolor{BaseOmm4UnknownOpaque}{HTML}{808080}

\colorlet{Omm2Transparent}{white!70!BaseOmm2Transparent}
\colorlet{Omm2Opaque}{white!70!BaseOmm2Opaque}

\colorlet{Omm4Transparent}{white!70!BaseOmm4Transparent}
\colorlet{Omm4Opaque}{white!70!BaseOmm4Opaque}
\colorlet{Omm4UnknownTransparent}{white!70!BaseOmm4UnknownTransparent}
\colorlet{Omm4UnknownOpaque}{white!70!BaseOmm4UnknownOpaque}

\begin{document}
\begin{center}
  \begin{tabular}{ll}
    \colorbox{BaseOmm4Transparent}{\texttt{-1}}        & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_TRANSPARENT\_EXT} \\
    \colorbox{BaseOmm4Opaque}{\texttt{-2}}             & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_OPAQUE\_EXT} \\
    \colorbox{BaseOmm4UnknownTransparent}{\texttt{-3}} & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_UNKNOWN\_TRANSPARENT\_EXT} \\
    \colorbox{BaseOmm4UnknownOpaque}{\texttt{-4}}      & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_UNKNOWN\_OPAQUE\_EXT}
  \end{tabular}
\end{center}

\begin{center}
  \begin{tabular}{ll}
    \colorbox{Omm4Transparent}{\texttt{-1}}        & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_TRANSPARENT\_EXT} \\
    \colorbox{Omm4Opaque}{\texttt{-2}}             & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_OPAQUE\_EXT} \\
    \colorbox{Omm4UnknownTransparent}{\texttt{-3}} & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_UNKNOWN\_TRANSPARENT\_EXT} \\
    \colorbox{Omm4UnknownOpaque}{\texttt{-4}}      & \texttt{VK\_OPACITY\_MICROMAP\_SPECIAL\_INDEX\_FULLY\_UNKNOWN\_OPAQUE\_EXT}
  \end{tabular}
\end{center}
\end{document}

The results however all become desaturated (greyscale):

latexml-colorbug

As a reference, the tex yields a PDF that looks like this: latexml-colorbug-ref