latex3 / xcolor

Driver-independent color extensions for LaTeX and pdfLaTeX
LaTeX Project Public License v1.3c
28 stars 5 forks source link

`Gray` color model broken #23

Closed SFr682k closed 11 months ago

SFr682k commented 2 years ago

Current behavior

Each of the following snippets fails with “Illegal unit of measure (pt inserted)” and “Missing number, treated as zero” errors.

Snippet 1 (Log file):

\documentclass{article}
\usepackage{xcolor}
\begin{document}
    \selectcolormodel{Gray}
    \definecolor{SomeColor}{Gray}{12}

    Hello World!
\end{document}

Snippet 2 (Log file):

\documentclass{article}
\usepackage{xcolor}
\begin{document}
    \selectcolormodel{Gray}
    \definecolor{SomeColor}{gray}{0.50}

    Hello World!
\end{document}

Snippet 3 (Log file)

\documentclass{article}
\usepackage{xcolor}
\begin{document}
    \selectcolormodel{Gray}

    \color{red}
    Hello World!
\end{document}

Expected behavior

The Gray color model “just works”

Environment

u-fischer commented 2 years ago

yes. A quite old bug. Happily the hycolor package contains a patch (https://tex.stackexchange.com/a/520379/2388). I will move it to xcolor, but for now you can load it directly (or load hyperref).

\documentclass{article}
\usepackage{xcolor}
\usepackage{xcolor-patch}
\begin{document}
    \selectcolormodel{Gray}
    \definecolor{SomeColor}{gray}{0.50}

    Hello World!
\end{document}
u-fischer commented 11 months ago

This has been fixed in version 3.00