I would like to use beamer defined colors into beamerarticle's version of my document. This way I can change beamer theme (or color theme) and colors change according it.
Here you have a MWE. A frame with a tikz figure using beamer colors fg and bg.
\documentclass[ignorenonframetext]{beamer}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{tikz}
\usecolortheme{beaver}
\begin{document}
This is some text outside any frame.
\begin{frame}{Frame}
\begin{alertblock}{Block}
\usebeamercolor[fg]{example text}
\begin{tikzpicture}
\filldraw[color=fg, fill=bg!50!white] (0,0) rectangle (5,3);
\draw[line width=5mm] (1,1)--(2,2);
\end{tikzpicture}
\end{alertblock}
\end{frame}
\end{document}
As soon as I try article with beamerarticle package, pdflatex complains with
! Package xcolor Error: Undefined color `fg'.
See the xcolor package documentation for explanation.
Type H <return> for immediate help.
...
l.16 ..., fill=bg!50!white] (0,0) rectangle (5,3);
The example contains a tikz figure but my question want to be more general, something like declaring sections (or any other text) with a beamer color and keeping this color in article mode.