[Tex/LaTex] Switch firstname and familyname colors in moderncv

colormoderncv

In the moderncv casual theme, in the header, the family name has a darker color than the first name. How can I make it the other way around, and more generally, set each name to a color of my choosing?

Best Answer

For recent versions of moderncv you need to use

\usepackage{etoolbox}
\patchcmd{\makecvtitle}{\color{color2!50}\@firstname}{\color{color2}\@firstname}{}{}
\patchcmd{\makecvtitle}{\color{color2}\@lastname}{\color{color2!50}\@lastname}{}{}

(Thank you, Gonzalo Medina!)


The following applies only for version 2008/06/17 v0.7 of moderncv


The names are typeset by the commands

\firstnamestyle
\familynamestyle

which are defined in moderncv.cls as follows

\providecommand*{\firstnamestyle}[1]{{\firstnamefont\color{firstnamecolor}#1}}
\providecommand*{\familynamestyle}[1]{{\familynamefont\color{familynamecolor}#1}}

You can adjust them to your liking via

\renewcommand*{\firstnamestyle}[1]{{<whatever>#1}}
\renewcommand*{\familynamestyle}[1]{{<whatever>#1}}

If you just want to switch the colors, your call would be

\providecommand*{\firstnamestyle}[1]{{\firstnamefont\color{familynamecolor}#1}}
\providecommand*{\familynamestyle}[1]{{\familynamefont\color{firstnamecolor}#1}}