[Tex/LaTex] Change colour of line numbers in listings package

colorlistings

While the documentation of the famous listings package explains to modify many things, I wonder how to change the colour of the line numbers when I use something like

\lstset{numbers=left, numberstyle=\tiny, stepnumber=2, numbersep=5pt}

Best Answer

Add it to the numberstyle

\documentclass{article}
\usepackage{listings,xcolor}

\lstset{numbers=left, numberstyle=\tiny\color{red}, stepnumber=2, numbersep=5pt}
\begin{document}
\begin{lstlisting}
a
b
c
\end{lstlisting}

\end{document}

enter image description here