我正在制作字形。我希望最终的形状有阴影。
为箭头创建阴影的效果与预期一致。在底部的弯曲路径下创建阴影则不行。当我按下按键时,反而会创建一个奇怪的纯灰色填充drop shadow
。如何将阴影放置在正确的位置*,就像箭头一样?
- = 任意偏移对我来说都有效。我将其用于
shadow xshift=.725pt, shadow yshift=-.725pt
箭头。
\documentclass[border={1pt -15pt 1pt 1pt},convert={density=3000,outext=.png}]{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings,shadows}
\tikzfading[name=fade,right color=black!10, left color=black]
\definecolor{rgray}{RGB}{188,188,214}
\begin{document}
\begin{tikzpicture}
\draw[path fading=fade, opacity=.5, drop shadow={shadow scale=.5, shadow xshift=-1.6pt, shadow yshift=1.5pt,
opacity=.5, fill=black}, fill=white, draw=rgray] (1.475,0.11) .. controls (1.45,.825) and (1.45,0.9875) .. (2,1);% how to get a shadow here?
\draw[path fading=fade, draw=rgray!100!black!90] (1.4375,.88) .. controls (1.45,.85) and (1.45,1.15) .. (2,1.2);
\draw[drop shadow={shadow scale=1, shadow xshift=.725pt, shadow yshift=-.725pt,
opacity=.5, fill=rgray!47}, fill=white, draw=rgray!50] (2,1) -- (2,.95) -- (2.23,1.1) -- (2,1.25) -- (2,1.2);
\end{tikzpicture}
\end{document}
答案1
这是匆忙做出的一些尝试。因此可能需要进行一些微调。
\documentclass[border={1pt -15pt 1pt 1pt},convert={density=3000,outext=.png}]{standalone}
\usepackage{tikz}
\usetikzlibrary{fadings,shadows}
\tikzfading[name=fade,right color=black!10, left color=black]
\definecolor{rgray}{RGB}{188,188,214}
\begin{document}
\begin{tikzpicture}
\draw[path fading=fade, postaction={drop shadow={shadow scale=1, shadow xshift=0.5pt, shadow yshift=-0.5pt, opacity=.8, fill=gray!40}}, fill opacity=.9, draw=rgray]
(1.475,0.11) .. controls (1.45,.825) and (1.45,0.9875) .. (2,1)
-- (2,1) -- (2,.95) -- (2.23,1.1) -- (2,1.25) -- (2,1.2)
.. controls (1.45,1.1) and (1.45,1.3) .. (1.475,0.011);
\path[fill=white]
(1.475,0.11) .. controls (1.45,.825) and (1.45,0.9875) .. (2,1)
-- (2,1) -- (2,.95) -- (2.23,1.1) -- (2,1.25) -- (2,1.2)
.. controls (1.45,1.1) and (1.45,1.3) .. (1.475,0.011);
\end{tikzpicture}
\end{document}