# How to define macro for colored text?

I know that it is possible to obtain colored text in Latex by including the color package and writing like

\textcolor{red}{This is red text}


How could I define a macro which would produce text of a given color such as

\red{This is red text}


?

-
\newcommand\red[1]{\color{red}#1} isn't good enough? Why you don't want to use \textcolor, too verbose? Maybe the question actually was about defining own macros? If yes, then see e.g. LaTeX/Customizing LaTeX from LaTeX wikibook. – przemoc Jul 11 '11 at 18:35
@przemoc: Your macro will switch to red color for every text following it, not only the macro's argument. Correct would be (e.g.) \newcommand\red[1]{{\color{red}#1}} (note the additional set of braces). – lockstep Jul 11 '11 at 18:40
@lockstep: Damn, right! Forgot about them... – przemoc Jul 11 '11 at 18:41

\newcommand{\red}[1]{\textcolor{red}{#1}} works. Or are you trying to do something more general, such that \somecolorname{foo} behaves the same as \textcolor{somecolorname}{foo}? That latter case is probably not a good idea...