# Changing font colors within a beamer theme [closed]

I'm using the Stockholm (sthlm) Beamer theme. The template for this theme shows how to use its Light Yellow font color:

\setbeamercolor{sthlmLightYellow}{fg=sthlmLightYellow,bg=white}
\begin{beamercolorbox}[wd=\linewidth,ht=2ex,dp=0.7ex]{sthlmLightYellow}
\texttt{sthlmLightYellow}
\end{beamercolorbox}


My question is, how would I set a single word in a line of text to be sthlmLightYellow, leaving the other words black? And suppose I wanted to have a few colors in this line -- how would I achieve that?

This is what I've come up with:

\setbeamercolor{sthlmLightYellow}{fg=sthlmLightYellow, bg=white}
\begin{beamercolorbox}[wd=\linewidth, ht=2ex, dp=0.7ex]{sthlmLightYellow}
\centerline{\texttt{Merkel cells} {\color{black} and}
{\color{cyan} \texttt{A$\beta$ sensory neurons}}
{\color{black} form Merkel cell-neurite complexes.}}


But I feel like there's got to be a simpler way.

## closed as unclear what you're asking by user36296, user31729, Fran, user13907, Stefan Kottwitz♦Dec 29 '15 at 21:52

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• With \textcolor{<selected color>}{colored text}? – Zarko Sep 20 '15 at 20:14
• @dbliss Does the comment from Zarko answer your question? – user36296 Dec 29 '15 at 18:21
• @dbliss: Zarko's comment was made soon after you posted the question. You gave no feedback on it -- Perhaps nobody can work with the fragments you provided, now three months later the question is unclear. That's why we like to have feedback by comments/votes/accepts. – user31729 Dec 29 '15 at 21:21
• @dbliss, what job you expect from me? To wrote an answer? You not respond on my comment, so I concluded that it doesn't work for you. When I use suggested solution it always wars! Anyway, I will convert my comment to answer .... – Zarko Dec 29 '15 at 21:25

\textcolor{<selected color>}{colored text}

This is valid for any document class, not only for Beamer. Of course, for this command the preamble of document should explicit or implicit loaded color or xcolor package.