我想知道是否有可能创建透明阴影效果(如下图所示),而无需精确指定填充颜色。此解决方案很好,直到我必须将背景更改为非实心填充(黄色块所示)。我可以用透明阴影以某种方式创建(几乎,我想看到黄线)相同的效果吗?
(抱歉,颜色太鲜艳了,这只是为了演示目的。)
\documentclass{article}
\usepackage{tikz}
\begin{document}
\parindent0pt
\null
\definecolor{orange}{RGB}{233,77,16}
\thispagestyle{empty}
\vspace{-1cm}
\vfill
\hfil
\begin{tikzpicture}[overlay]
\coordinate (gNE) at (+0.501\paperwidth,+0.501\paperheight);
\coordinate (gSW) at (-0.501\paperwidth,-0.501\paperheight);
\coordinate (titleN) at (+0.000\paperwidth,+0.300\paperheight);
\coordinate (titleS) at (+0.000\paperwidth,+0.100\paperheight);
\fill [color=orange] (gSW) rectangle (gNE);
\fill [color=yellow] (0.3\paperwidth,0.51\paperheight) rectangle (0.4\paperwidth,-0.5\paperheight);
\shade [left color=black, right color=orange] (titleS -| gSW) rectangle (titleN -| gNE);
\end{tikzpicture}
\vfill
\end{document}
答案1
您可以使用库path fading=east
中的fadings
以下方法:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings}
\begin{document}
\parindent0pt
\null
\definecolor{orange}{RGB}{233,77,16}
\thispagestyle{empty}
\vspace{-1cm}
\vfill
\hfil
\begin{tikzpicture}[overlay]
\coordinate (gNE) at (+0.501\paperwidth,+0.501\paperheight);
\coordinate (gSW) at (-0.501\paperwidth,-0.501\paperheight);
\coordinate (titleN) at (+0.000\paperwidth,+0.300\paperheight);
\coordinate (titleS) at (+0.000\paperwidth,+0.100\paperheight);
\fill [color=orange] (gSW) rectangle (gNE);
\fill [color=yellow] (0.3\paperwidth,0.51\paperheight) rectangle (0.4\paperwidth,-0.5\paperheight);
\fill [black, path fading=east] (titleS -| gSW) rectangle (titleN -| gNE);
\end{tikzpicture}
\vfill
\end{document}