[Tex/LaTex] pstricks and beamer – problem maybe with xcolor

beamercolorps2pdfpstricks

While creating beamer slides in our comporate design (which forced me using own colors) I got the following problem:
Having a PS-Tricks image within a frame seems to collide with my own color setted up for the foreground text.
Compiling works fine (latex and further dvips) – but running ps2pdf oder viewing the Postscript file results in the following error:

Error: /undefined in XC@mytext
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1159/1684(ro)(G)--   --dict:0/20(G)--   --dict:142/200(L)--   --dict:1
75/300(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 149367
MiKTeX GPL Ghostscript  9.00: Unrecoverable error, exit code 1

I think there seems to be a problem with my color "mytext" – but I do not know, how to solve that.
My minimal example for reproduction is

\documentclass{beamer}
\DefineNamedColor{named}{mytext}{RGB}{144,132,118}
\setbeamercolor{normal text}{fg=mytext}
\usepackage{pst-all}%,auto-pst-pdf
\begin{document}
\begin{frame}
\begin{pspicture}(-4,-4)(4,4)
\pscircle*(-2,2){0.5}
\end{pspicture}\par%
Toll
\end{frame}
\end{document}

The problem occurs using MikTeX on Win* or TeXlive on Linux…

Best Answer

This is not a beamer problem. I get the same error with article. \DefineNamedColor is a command from the old color.sty and I would say there is somewhere a bug in the adaption of xcolor (or you are using it not correctly). The problem disappears if one use the genuine xcolor command:

\documentclass{beamer}
%\DefineNamedColor{named}{mytext}{RGB}{144,132,118}
\definecolor{mytext}{RGB}{144,132,118}
\setbeamercolor{normal text}{fg=mytext}
\usepackage{pst-all}%,auto-pst-pdf
\begin{document}
\begin{frame}
\begin{pspicture}(-4,-4)(4,4)
\pscircle*(-2,2){0.5}
\end{pspicture}\par%
Toll
\end{frame}
\end{document}
Related Question