I'm using fancyhdr package and have this tex file:
\documentclass[a4paper]{testcv}
\usepackage{fontspec}
\usepackage[russian]{babel}
\footersection{\today}{Footer text}{}
\begin{document}
Page text
\end{document}
And this class file:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{testcv}[2016/02/10 CV class]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[titlepage]{article}
\usepackage{fontspec}
\usepackage{color}
\usepackage{fancyhdr}
\fancyhfoffset{0em}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\pagestyle{fancy}
\usepackage[usenames,dvipsnames]{xcolor}
\definecolor{contentcolor}{HTML}{A6A6A6}
\definecolor{footercolor}{HTML}{FF0000}
% (1) Footer color == contentcolor
\setmainfont[Color=contentcolor, Path = ../fonts/ubuntu/]{Ubuntu-L}
% (2) Footer color is ok
% \setmainfont[Path = ../fonts/ubuntu/]{Ubuntu-L}
\renewcommand{\footrulewidth}{0.5pt}
\def\footrule{{
\vskip-\footruleskip\vskip-\footrulewidth
\color{footercolor}
\hrule\@width\headwidth\@height
\footrulewidth\vskip\footruleskip
}}
\newcommand{\footersection}[3]{
\fancyfoot{}
\fancyfoot[L]{\color{footercolor}#1}
\fancyfoot[C]{\color{footercolor}#2}
\fancyfoot[R]{\color{footercolor}#3}
}
With (1) uncommented I have this output with wrong color:

If we use (2) instead then page text color is black, but footer works ok:

Compiling with XeLaTeX on Windows.
How can I set \setmainfont[Color=contentcolor] and have correct red footer?
Already found this answer, but i can't use it.
\newfontfamily\footerfontfamily[Color=footercolor, Path = ../fonts/ubuntu/]{Ubuntu-L}and then use\footerfontfamilyin the footer. – Ulrike Fischer Jul 07 '16 at 12:16Color-key in \setmainfont, this color always wins, you no longer can change it with the \color command. (\addfontfeature{Color=green}Greenshould work, but I normally avoid to use\addfontfeatureto often). – Ulrike Fischer Jul 07 '16 at 14:22