
我想smartdiagram
將前面的框框的顏色也用於箭頭,而不是它所通往的框框。因此在這張圖片中:
我希望綠色箭頭是紅色,藍色箭頭是綠色,橘色箭頭是藍色,紅色箭頭是橘色。
我怎樣才能實現這個目標?這是我的 MWE:
\documentclass[border=3mm]{standalone}
\usepackage{smartdiagram}
\tikzset{
every shadow/.style={
fill=none,
shadow xshift=0pt,
shadow yshift=0pt}
}
\tikzset{module/.append style={top color=\col,bottom color=\col}}
\smartdiagramset{%
module shape=rectangle,
text color=white,
border color=none,
}
\smartdiagramset{set color list={red,green,blue,orange}}
\begin{document}
\sffamily
\smartdiagram[flow diagram:horizontal]{elem1,elem2,elem3,elem4}
\end{document}
答案1
https://tex.stackexchange.com/a/126481/197451
\documentclass[border=3mm]{standalone}
\usepackage{smartdiagram}
\tikzset{
every shadow/.style={
fill=none,
shadow xshift=0pt,
shadow yshift=0pt}
}
\tikzset{module/.append style={top color=\col,bottom color=\col}}
\smartdiagramset{%
module shape=rectangle,
text color=white,
border color=none,
}
\makeatletter
\smartdiagramset{
flip arrow colors/.style={
/tikz/diagram arrow type/.prefix code={%
\edef\col{\@nameuse{color@\xi}}%
}
}
}
\smartdiagramset{flip arrow colors}
\begin{document}
\sffamily
\smartdiagram[flow diagram:horizontal]{elem1,elem2,elem3,elem4}
\end{document}