see the following MWE I am trying to find a solution for the following task.

The outer rectangle should start with white color, also the inner one. the rectangle between is only for demonstration purposes and the color should be red.

The area between inner and outer rectangle should be colorized (white - red -white) and the area of the inner rectangle should remain white.

I was playing with pst-grad and pst-slpe but I cannot handle this in a right way.

\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass{article}

\usepackage{pst-node}
\usepackage{pst-blur}
\usepackage{pst-slpe}
\usepackage{multido, pst-intersect, pst-tools,multicol}

\usepackage[a4paper,margin=0cm]{geometry}
\usepackage{auto-pst-pdf}

\begin{document}

\begin{pspicture}[showgrid=false](-1.25,0)(50,-32)

\rput(0,-2.5){\psframe[linecolor=black!10,fillstyle=solid,fillcolor=white](0.75,-2)(16.5,-27.0)}
\end{pspicture}

\end{document}


Any ideas?

Here's a TikZ solution. If you need to stick to pstricks, perhaps the same method could be applied there which is, basically, to fill the entire rectangle and to then fill 4 trapeziums to make the borders. (But the borders could be larger than the bit in the middle, of course. This is just how I thought about it.)

\documentclass[border=10pt,multi,tikz]{standalone}
\begin{document}
\begin{tikzpicture}
[
vshade/.style={bottom color=white, top color=white, middle color=red},
hshade/.style={left color=white, right color=white, middle color=red},
]
\def\borderwidth{10pt}
\fill [white] (-5,-3) coordinate (d) rectangle (5,3) coordinate (b);
\shade [vshade] (d |- b) coordinate (a) -- (b) -- +(\borderwidth,\borderwidth) coordinate (B) -- (a |- B) -- +(-\borderwidth,0) coordinate (A) -- cycle;
\shade [vshade] (d) -- (d -| b) coordinate (c) -- +(\borderwidth,-\borderwidth) coordinate (C) -- (d |- C) -- +(-\borderwidth,0) coordinate (D) -- cycle;

• +1 yes, I think this is the right general approach for the pstricks too. Aug 28, 2016 at 23:18