Accessing colors defined by a beamer color theme for a standalone tikzpicture

This is a follow-up to this question.

I use the standalone documentclass to externalize my tikzpictures. Now, I want to include it in a beamer presentation with its color theme set to, say, default. I'd like that the colors I use in the standalone tikzpicture match those defined in the presentation (structure, normal text.fg, example text.fg, etc). How can I do?

Ideally, I'd like something like

\documentclass{standalone}
\usepackage{tikz}
\ImportColorDefinitionsFromBeamerColorTheme{default}
\begin{document}
\begin{tikzpicture}
\draw[structure.fg] (0,0) -- (1,1);
\draw[palette primary.fg] (0,1) -- (1,0);
\end{tikzpicture}
\end{document}


(notice that palette primary.fg won't work in beamer either, one need to use \usebeamercolor[fg]{palette primary} and I don't know how to do it with tikz).

\documentclass[tikz,beamer]{standalone}

• Minor issue though: the resulting bounding box fits the frame (IIUC) and no more the tikzpicture. – cjorssen Jan 8 '14 at 11:39