This code:
\documentclass[tikz,border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[scale=4]
\begin{scope}[on background layer]
\draw[fill, top color=black, bottom color=white, shading=axis, shading angle=-33.02]
(1,1) -- (-1,1) -- (-1,0.8) -- (1,-0.5) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}
produces the following polygon with a color gradient orthogonal to the diagonal line.
I have two problems:
1) The gradient should always be orthogonal to the diagonal line. How can I compute automatically the right angle? Is there another way to define the direction of the gradient / shading?
2) The shading does not really go from white to black. I want the shading to be white at the diagonal line and black in the upper right corner. What is the right way to do that?