[pstricks] pstricks and \ColoredOverlappedSurfaces
Herbert Voss
Herbert.Voss at alumni.TU-Berlin.DE
Wed Feb 23 18:51:28 CET 2005
William Dieterich wrote:
> Thank you for responding to my post. I added
please answer to the list and not as private mail
> \PassOptionsToPackage{dvipsnames}{pstricks} as you suggested, but I
> still get the error. Below is a chunk of prosper-tour.tex that gives me
> the problem. I also get the error in the mixed-colors.tex, but only on
> the overlapped objects that use LemonChiffon and LightBlue colors - the
> other examples of overlapped surfaces run without any errors popping up.
> Thank you again for helping me with my naïve questions.
>
> Bill
>
>
> \PassOptionsToPackage{dvipsnames}{pstricks}
>
> \documentclass[pdf,autumn,slideColor,colorBG]{prosper}
the problem is the pdf option. Without, it works.
--> Hendri, can you have a look please, it is the \ifDVItoPS
switch
Herbert
>
> \usepackage[latin1]{inputenc}
> \usepackage{pstricks,pst-node,pst-text,pst-3d}
> \usepackage{amsmath}
> % Definition of new colors
> \newrgbcolor{LemonChiffon}{1. 0.98 0.8}
> \newrgbcolor{LightBlue}{0.68 0.85 0.9}
>
> % > BEGIN OF OVERLAPPED COLORS
> % Code below devised by Denis Girou (CNRS/IDRIS - France,
> Denis.Girou at idris.fr)
> \newrgbcolor{LemonChiffon}{1. 0.98 0.8}
> \newrgbcolor{LightBlue}{0.68 0.85 0.9}
> \makeatletter
> \newdimen\pst at dimz
>
> % Draw two overlapped surfaces, with computation of the mixed color for
> % the intersection of the surfaces
> % #1=first surface, #2=color of first surface,
> % #3=second surface, #4=color of second surface
> \def\ColoredOverlappedSurfaces#1#2#3#4{%
> \psset{fillstyle=solid}
> % Decode the three components of the first RGB color
> \DecodeRGBFirstColor{\csname color@#2\endcsname}%
> \psset{fillcolor=#2}
> % Draw first surface
> #1
> % Decode the three components of the second RGB color
> \DecodeRGBSecondColor{\csname color@#4\endcsname}%
> % Compute the mixed color
> \BuildMixedColor
> % Draw second surface
> \psclip{\psset{fillcolor=#4}#3}
> \psset{fillcolor=MixedColor}
> % Redraw overlapped surface in the mixed color
> #1
> \endpsclip}
>
> % Get the three components of the first color
> \def\DecodeRGBFirstColor#1{%
> \pst at expandafter\pst at getnumiii{#1} {} {} {} {}\@nil
> \edef\pst at FirstColorR{\pst at tempg}%
> \edef\pst at FirstColorG{\pst at temph}%
> \edef\pst at FirstColorB{\pst at tempi}%
> %\typeout{Color 1=\pst at tempg,\pst at temph,\pst at tempi}% Debug
> }
>
> % Get the three components of the second color
> \def\DecodeRGBSecondColor#1{%
> \pst at expandafter\pst at getnumiii{#1} {} {} {} {}\@nil
> \edef\pst at SecondColorR{\pst at tempg}%
> \edef\pst at SecondColorG{\pst at temph}%
> \edef\pst at SecondColorB{\pst at tempi}%
> %\typeout{Color 2=\pst at tempg,\pst at temph,\pst at tempi}% Debug
> }
>
> % Build the mixed RBG color (by means of each three components)
> \def\BuildMixedColor{%
> % Resulting R component
> \pst at dimz=\pst at FirstColorR pt
> \advance\pst at dimz\pst at SecondColorR pt
> \divide\pst at dimz\tw@
> \pst at dimtonum{\pst at dimz}{\pst at MixedColorR}%
> % Resulting G component
> \pst at dimz=\pst at FirstColorG pt
> \advance\pst at dimz\pst at SecondColorG pt
> \divide\pst at dimz\tw@
> \pst at dimtonum{\pst at dimz}{\pst at MixedColorG}%
> % Resulting B component
> \pst at dimz=\pst at FirstColorB pt
> \advance\pst at dimz\pst at SecondColorB pt
> \divide\pst at dimz\tw@
> \pst at dimtonum{\pst at dimz}{\pst at MixedColorB}%
> % Definition of the mixed color MixedColor
> \newrgbcolor{MixedColor}{%
> \pst at MixedColorR\space \pst at MixedColorG\space \pst at MixedColorB}
> %\typeout{Mixed color=\csname color at MixedColor\endcsname}% Debug
> }
> \makeatother
> % < END OF OVERLAPPED COLORS
>
> \begin{document}
>
> %----------------------------------------------------------------------
>
> %----------------------------------------------------------------------
> SLIDE -
> \overlays{2}{%
> \begin{slide}[Glitter]{Overlaps of colors}
> Intersection of sets. First the yellow one\dots\onlySlide{2}{Then
> the blue one.}%
> \rput(4,-2){%
> \onlySlide{1}{%
>
> \psellipse[fillstyle=solid,fillcolor=LemonChiffon](0.3,-0.7)(1.5,1)}%
> \onlySlide{2}{%
> \ColoredOverlappedSurfaces{\pscircle{1}}{LightBlue}%
> {\psellipse[fillstyle=solid,%
> fillcolor=LemonChiffon](0.3,-0.7)(1.5,1)}{%
> LemonChiffon}}}%
> \OnlySlide{2}%
> {\green Remember how to do that with MS PowerPoint?}
> \end{slide}
> }
> %-----------------------------------------------------------------------
> --
>
> \end{document}
>
--
http://TeXnik.de/
http://PSTricks.de/
ftp://ftp.dante.de/tex-archive/info/math/voss/Voss-Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
More information about the PSTricks
mailing list