0

I'm compiling the following code

\documentclass[tikz]{standalone}

\usepackage[rgb]{xcolor}
\usepgflibrary {shadings}

\begin{document}
    \begin{tikzpicture}

        \tikzset{%
            vertex/.pic={%
                code={%
                    \shade[shading=radial, outer color=cyan!80!black, inner color = white] (0, 0) circle (0.1cm);
                }}}
        \path (0, 0) pic[color=red] {vertex};
    \end{tikzpicture}
\end{document}
  1. The produced image is cyan and not red [this is less important]
  2. The log contains the
Missing character: There is no c in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no = in font nullfont!

My question: why is the second happens?

1 Answer 1

2

There should be no code=. Add the code directly (but 0.1cm radius is rather small, you won't see much):

\PassOptionsToClass{rgb}{xcolor}
\documentclass[tikz]{standalone}

\usepgflibrary {shadings}

\begin{document}
    \begin{tikzpicture}
        \tikzset{%
            vertex/.pic={%
                    \shade[shading=radial, outer color=cyan!80!black, inner color = white] (0, 0) circle (0.1cm);
                }}
        \path (0, 0) pic[color=red] {vertex};
    \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .