\selectcolormodel{gray} not applied to \draw

The following workaround redefines the color in the current target color model via \colorlet[named]{<color>}{<color>}. A \colorlet without [named] does not redefine the color in the target color model, which seems also the problem with the TikZ, which uses \colorlet in \pgfsetfillcolor. As "unknown" option, TikZ uses \color instead, which converts the color on usage (depending on switch \ifconvertcolorU).

\documentclass{article}

\usepackage{xcolor}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}

    \draw [fill=cyan] (0,0) rectangle (1,1);
    \fill [cyan] (2,0) rectangle (3,1);

\end{tikzpicture}

\selectcolormodel{gray}

\begin{tikzpicture}

    % \colorlet{cyan}{cyan} alone does not convert the color space
    \colorlet[named]{cyan}{cyan}%

    \draw [fill=cyan] (0,0) rectangle (1,1);
    \fill [cyan] (2,0) rectangle (3,1);

\end{tikzpicture}

\end{document}

Result

Tags:

Color

Tikz Pgf