[Tex/LaTex] Circuitikz line and component color

circuitikz

I wish to make a component (capacitor) in my circuit a different color (blue).

When I use the code:

\begin{document}
\usepackage{circuitikz}
\begin{center}
\begin{circuitikz} 
\draw(0,0) to [C,l_=$C$,*-*,color=blue](0,2);
\end{circuitikz}
\end{center}
\end{document}

This happens:

But I want the lines going to the capacitor to be blue too and not black.
How do I do this if I wish to add additional components to my circuit later on and want those to be black?

Can I also make the label C blue too?

Thanks

Best Answer

If you add the option [blue] to your draw command, everything should be fine. If you want to revert to the default color, you end the blue draw command with a semicolon and begin a new draw command without the blue color options.

\documentclass{standalone}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz}
    \draw[blue] (0,0) to [C,l_=$C$,*-*,color=blue] (0,2);
    \draw (2,0) to [C,l_=$C$,*-*] (2,2);
\end{circuitikz}

\end{document}

Capacitors

Related Question