# Change email text color in moderncv

I'm having an issue trying to change the text color of the email in moderncv.

I defined my own color like this :

\definecolor{mycolor}{RGB}{0,0,0}


Then I add the email like this :

\email{\textcolor{mycolor}{email@gmail.com}}


main.tex, line 45 Package xcolor Error: Undefined color rgb(0,0,0)'. See the xcolor package documentation for explanation. Type H for immediate help. ... l.45 \makecvtitle Try typing to proceed If that doesn't work, type X to quit.

If I try it on the phone instead, it works

\phone[mobile]{\textcolor{mycolor}{+123456789}}


But I have no idea why it doesn't work for email

You can change the patch I used in your last question to solve this problem too.

\usepackage{etoolbox}
\makeatletter
} % <replace>
{}{} % <success><failure>
\makeatother


to your preamble. So with the following MWE

\documentclass[10pt,a4paper,sans]{moderncv}

\moderncvstyle[right]{classic}
\moderncvcolor{burgundy}

\usepackage[utf8]{inputenc}
\usepackage[scale=0.8]{geometry}
\usepackage{setspace}
\usepackage{multicol}
\setlength{\hintscolumnwidth}{2.8cm}
\renewcommand*{\namefont}{\fontsize{24}{0}\bfseries\upshape}
\firstname{\vspace{2mm}John\vspace{2mm}}
\lastname{Doe}

\email{john.doe@gmail.com}
\photo[50pt][1pt]{photo}

\definecolor{mycolor}{RGB}{0,0,0}
\phone[mobile]{\textcolor{mycolor}{+123456789}}

\usepackage{etoolbox}
\makeatletter
`