스마트다이어그램의 화살표를 원래 상자의 색상으로 만들 수 있나요?

스마트다이어그램의 화살표를 원래 상자의 색상으로 만들 수 있나요?

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}

관련 정보