TikZ - 结合淡入淡出和填充不透明度

TikZ - 结合淡入淡出和填充不透明度

我正在尝试使用透明填充并设置形状的总透明度。下面的示例应该是上面两个示例的组合。我如何操纵包含的整体形状的透明度值fading=...?提前谢谢您!

编辑:我使用 LaTeX Workshop(由 James Yu 编写)查看 VS Code 上的输出。切换到 Adob​​e Acrobat Reader 可以完美呈现输出。谢谢赫佩克里斯蒂安森寻求答案并建议使用其他查看器。

输出

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings}

\begin{document}
\begin{tikzpicture}
    \begin{scope}
        \node at (2, 1.5){Only \verb|fill opacity|};
        \filldraw[fill=blue,fill opacity=0.01](0,0) circle (1cm);
        \filldraw[fill=blue,fill opacity=0.50](2,0) circle (1cm);
        \filldraw[fill=blue,fill opacity=1.00](4,0) circle (1cm);
    \end{scope}
    \begin{scope}[yshift=-4cm]
        \node at (2, 1.5){With \verb|path fading=south|};
        \filldraw[fill=blue,path fading=south](0,0) circle (1cm);
        \filldraw[fill=blue,path fading=south](2,0) circle (1cm);
        \filldraw[fill=blue,path fading=south](4,0) circle (1cm);
    \end{scope}
    \begin{scope}[yshift=-8cm]
        \node at (2, 1.5){With \verb|path fading=south| and \verb|fill opacity|};
        \filldraw[fill=blue,fill opacity=0.01,path fading=south] (0,0) circle (1cm);
        \filldraw[fill=blue,fill opacity=0.50,path fading=south] (2,0) circle (1cm);
        \filldraw[fill=blue,fill opacity=1.00,path fading=south] (4,0) circle (1cm);
    \end{scope}
\end{tikzpicture}
\end{document}

答案1

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{fadings}
\begin{document}
\begin{tikzpicture}
\node at (2, 1.5){With \verb|path fading=south| and \verb|fill opacity|};
\filldraw[fill=blue, path fading=south, fill opacity=0.01] (0,0) circle[radius=1cm];
\filldraw[fill=blue, path fading=south, fill opacity=0.50] (2,0) circle[radius=1cm];
\filldraw[fill=blue, path fading=south, fill opacity=1.00] (4,0) circle[radius=1cm];
\end{tikzpicture}
\end{document}

三个淡化的蓝色圆圈

相关内容