[pstricks] closed Shadow in pscustom

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Sat Apr 17 00:41:47 CEST 2004


vincent wrote:
> Herbert Voss wrote:
> 
>> vincent wrote:
>>
>>> In my point of view, the patched behaviour which you sent me seems 
>>> more consistant, and more flexible (you can get the old behaviour by 
>>> adding a fillstyle=solid as a paramter of pscustom).
>>
>>
>>
>> the patch was only to demonstrate how shadowing works.
>> \closedhadow[fillcolor=..] does it anyway, just as you like.
>>
> You can choose the color, but there is no possibility for transparency !
> 
>> not in pstricks itself, the code is frozen, but maybe in
>> my collection of all exotic stuff, pstricks-add
> 
> 
> 
> OK. That may be nice.

here is an example with a "real" transparency color :-)

Herbert

\documentclass{article}
\usepackage{pstricks}
\begin{document}

\makeatletter
\def\pst at closedshadow{%
     \def\@fillstyle{solid}
     \addto at pscode{%
         gsave
         \psk at shadowsize \psk at shadowangle \tx at PtoC
         \tx at Shadow
         \pst at usecolor\psshadowcolor
         gsave fill grestore
         stroke
         \ifx\psk at fillstyle\@fillstyle
           grestore
           gsave
           \pst at usecolor\psfillcolor
           gsave fill grestore
           stroke
         \fi
         grestore%
     }%
}
\makeatother

\newpsstyle{TransparencyRed}{% Text
     fillstyle=vlines,hatchcolor=red,
     hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth}

\begin{pspicture}(0,-0.5)(5,2.2)
\pscustom[style=TransparencyRed,shadowcolor=lightgray,%
     shadowsize=10pt,shadowangle=30]{
   \psbezier(0,0)(1,1)(1,-1)(2,0)
   \psbezier(2,0)(3,1)(1,1)(2,2)
   \closepath
   \closedshadow
}
\rput(2.5,0){
\pscustom[style=TransparencyRed,shadowcolor=lightgray,%
     shadowsize=10pt,shadowangle=30,fillstyle=solid]{
   \psbezier(0,0)(1,1)(1,-1)(2,0)
   \psbezier(2,0)(3,1)(1,1)(2,2)
   \closepath
   \closedshadow
}}
\end{pspicture}

\end{document}




More information about the PSTricks mailing list