# set duo tone color of fontawesome5 duotone icons

With the fontawesome5 package one now has duotones. How can i set the second color?

\documentclass[a4paper]{scrartcl}
\usepackage[no-math]{fontspec}
\usepackage[pro]{fontawesome5}%
\begin{document}
\color{red}\faIcon[duotone]{university}
\end{document}


yields

Is there a way to change the gray color?

Starting with package version 5.13.0, changing the secondary color normally shouldn't be necessary because it automatically adapts to the current text color. If you still want to change it, you can use \faDuotoneSetSecondary to change the color:

\documentclass[a4paper]{scrartcl}
\usepackage{xcolor}
\usepackage[pro]{fontawesome5}%
\begin{document}
Default color: \textcolor{red}{\faIcon[duotone]{university}}

Orange: \textcolor{red}{\faIcon[duotone]{university}}
\end{document}


There is currently no user-level interface for this but only a code level (expl3) interface: You have to set the \l_fontawesome_duotone_secondary_style_tl token list to the commands which should be called for the secondary layer:

\documentclass[a4paper]{scrartcl}
\usepackage{xcolor}
\usepackage[pro]{fontawesome5}

\ExplSyntaxOn

\tl_set:Nn \l_fontawesome_duotone_secondary_style_tl {
\color{.!50!white} % Of course you could also load another color here
}

\ExplSyntaxOff

\begin{document}
\color{red}\faIcon[duotone]{university}
\end{document


I plan to add a proper interface in a later version, so that you will be able to set it with \fa??? {\color{secondarycolor}} but I'm not sure yet what \fa??? should be. Candidates are e.g. \faSecondaryColor, \faSetSecondary, \faSetSecondaryColor, \faDuotoneSetSecondary etc. If you have any suggestions feel free to comment here or send me a mail.

• Awesome! Your solution is exactely what I was looking for because it now depends on the main color. Maybe that could get the default? And thanks for the info on the feature. One could also do \faIcon[duotone][secondary-color]{name} as an optional to change a single one; but a \faSetSecondary or \faDuotoneSetSecondary for the global would also be nice. Finally, one could play with the tikz features of .fg and .bg as first and second colors. – Ronny Feb 17 at 21:16
• @Ronny The version in the answer might become the default in the next release. It's technically a breaking change, but it seems to be strictly better than the current one and it's mostly undocumented behaviour anyway. – Marcel Krüger Feb 17 at 21:18
• That's why I opened the topic, I couldn't find a documentation. Thanks for answeing so fast, your solution works perfectly! – Ronny Feb 17 at 21:19
• Your answer is between my favorities :-). – Sebastiano Feb 17 at 22:59