I want to draw rounded colored text box using mdframed. I'm trying to set background color to green or blue, used in example and theorem environments using \usebeamercolor:
\begin{mdframed}[roundcorner=5pt, backgroundcolor=\usebeamercolor[fg]
{block title example}, align=center, userdefinedwidth=4cm, fontcolor=white]
Sequential consistency
\end{mdframed}
I got the following error:
! Argument of \tikz@swap@args has an
extra }.
Seems like I can't use commands inside []. How could I fix it? When I use just blue!50!black everything works just fine.
MWE:
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usepackage[framemethod=TikZ]{mdframed}
\begin{document}
\begin{frame}[fragile]
\begin{mdframed}[roundcorner=5pt, backgroundcolor=\usebeamercolor[fg]{block title example}, align=center, userdefinedwidth=4cm, fontcolor=white] %\usebeamercolor[fg]{block title example}
Sequential consistency
\end{mdframed}
\end{frame}
\end{document}

backgroundcolor=fgwhich has the same effect. – bloodworks Feb 04 '13 at 18:56fgsays almost nothing in case you use several different colors). – Claudio Fiandrino Feb 04 '13 at 19:34