2

As a follow-up to the fundamental question Opacity and transparency, I'm wondering if it is possible to use opacity effectively in PSTricks with a gradient filling. The MWE provided by the answer to the post linked above does not work when the filling is switched to a gradient. I'm compiling following the chain latex -> dvips -> ps2pdf.

\documentclass{article}
\usepackage{pstricks,pst-grad} 

\begin{document}

\begin{pspicture}(-2,-2)(2,2)
  \psline[linecolor=blue,linewidth=12pt](-2,-2)(2,2)
  %\psframe[fillstyle=solid,fillcolor=red,opacity=0.5](-1,-1)(1,1)
  \psframe[fillstyle=gradient,gradbegin=red,opacity=0.5](-1,-1)(1,1)
\end{pspicture}

\end{document}
3
\documentclass{article}
\usepackage{pstricks,pst-slpe} 

\begin{document}

    \begin{pspicture}(-2,-2)(2,2)
    \psline[linecolor=blue,linewidth=12pt](-2,-2)(2,2)
    \psframe[fading,startfading=0.3,endfading=0.8,
       fillstyle=slope,slopebegin=red,slopeangle=90,opacity=0.6](-1,-1)(1,1)
    \end{pspicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.