
ドロップ シャドウのあるノードで不透明度を半透明 (例: opacity=0.2
) に正しく設定するにはどうすればよいですか? 「単純な」アプローチでは、半透明の塗りつぶしを通して影が表示されるようですが、これは理にかなっています。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\node [
draw,
fill=white,
circle,
blur shadow={
shadow blur steps=5
},
minimum size=1cm,
] at (0,0) {X};
\node [
draw,
fill=white,
circle,
blur shadow={
shadow blur steps=5
},
minimum size=1cm,
opacity=0.2,
] at (2,0) {X};
\end{tikzpicture}
\end{figure}
\end{document}
左側のノードの半透明のコピーを取得するにはどうすればよいですか?
編集:
私はすでに設定してみましたがdraw opacity
、結果はやや良くなりましたtext opacity
opacity
しかし、影は完全に不透明になっているようです ( なのでfill
、だと思います)。そのため、まだ 100% 希望どおりではありません。
答え1
おそらくtransparency group
あなたが探しているのは次のものです:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\begin{document}
\begin{tikzpicture}
\draw[cyan] (-1,-1) grid (3,1);
\node [
draw,
fill=white,
circle,
blur shadow={
shadow blur steps=5
},
minimum size=1cm,
] at (0,0) {X};
\begin{scope}[transparency group, opacity=0.2]
\node [
draw,
fill=white,
circle,
blur shadow={
shadow blur steps=5
},
minimum size=1cm,
] at (2,0) {X};
\end{scope}
\end{tikzpicture}
\end{document}
答え2
これはすでに適切な不透明度だと思います。期待される結果が何なのかわかりません。これは何に使うのですか?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows.blur}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\draw [help lines,step=0.5cm] (-2,-2) grid (2,2);
\node [
font=\huge,
circle,
line width=3pt,
draw,
draw opacity=0.4,
fill=white,
fill opacity=0.7,
text opacity=0.4,
blur shadow={
shadow blur steps=5,
shadow blur radius=1.5ex,
},
minimum size=2cm,
] at (0,0) {test};
\end{tikzpicture}
\end{figure}
\end{document}