I would like to define these commands:
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\red}[1]{\textcolor{red}{#1}}
When I try to use \green the output corresponds to the command \red. This shows that, other than the last one, the previous definitions are being ignored or replaced by the last one, perhaps because all are based on the same "basic" command, namely \textcolor.
EDIT
Thank you to all for your answers. Here is a MWE (rather a minimal "not-working" example hehe). It seems that there is indeed a problem with the cprotect package, which I need in order to be able to use the verb environment inside the macros. Not only the previous macro definitions are being ignored, but the vertical spacing is not being applied, too.
If the best course of action is to ask a separate question, don't hesitate to tell me.
\documentclass[border=5mm]{standalone}
\usepackage{xcolor,cprotect}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\cMakeRobust\green
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\cMakeRobust\blue
\newcommand{\red}[1]{\textcolor{red}{#1}}
\cMakeRobust\red
\begin{document}
\green{Huey $e^{\pi i}+1=0$ (math is OK)}\newline
\newline\blue{Dewey \verb|I'm using verbatim here $e^{\pi i}+1=0$|}
\\[3mm]\red{\textbf{Louie}}
\vspace{3mm}\green{Vertical spacing is not working, too.}
\end{document}


\textcolorby mistake. You can use it in as many definitions as you wish. – cfr Mar 12 '17 at 02:15\usepackage{color}, and they work as expected. You should post a MWE that exhibits the problem you claim to have. – GuM Mar 12 '17 at 02:18\documentclass{article} \usepackage{xcolor} \begin{document} \newcommand{\green}[1]{\textcolor{green}{#1}} \newcommand{\blue}[1]{\textcolor{blue}{#1}} \newcommand{\red}[1]{\textcolor{red}{#1}} \green{green} \blue{blue} \red{red} \red{green} \green{blue} \blue{red} \end{document}– cfr Mar 12 '17 at 02:18verbsometimes inside the macros. Unfortunately, theverbenvironment doesn't work inside macros; solving this is precisely the purpose of thecprotectpackage. – Matemáticos Chibchas Mar 12 '17 at 04:50\cMakeRobustdoes not maintain the color stack – Mar 12 '17 at 18:47