![Smartdiagram 包:附加功能中的不同填充颜色](https://linux22.com/image/337820/Smartdiagram%20%E5%8C%85%EF%BC%9A%E9%99%84%E5%8A%A0%E5%8A%9F%E8%83%BD%E4%B8%AD%E7%9A%84%E4%B8%8D%E5%90%8C%E5%A1%AB%E5%85%85%E9%A2%9C%E8%89%B2.png)
我正在使用智能图表包来绘制图表,并且我正在使用附加功能。
我想对每个附加内容使用不同的填充颜色,但到目前为止我还不知道这是否可行。
这是我的 MWE,其中所有附加内容都填充了gray!20
\documentclass{article}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
\begin{document}
\centering
\smartdiagramset{
set color list={red!10, red!30,red!50},
sequence item border color=black,
sequence item text color=black,
sequence item border size=1.2\pgflinewidth,
sequence item font size=\scriptsize\sffamily,
additions={
additional item shape=rectangle,
additional item fill color=gray!20,
additional item border color=black,
additional arrow line width=2pt,
additional arrow tip=to,
additional arrow color=black,
additional item font=\scriptsize\sffamily,
}
}
\smartdiagramadd[sequence diagram]{step 1,step 2, step 3}
{above of sequence-item1/input,below of sequence-item2/output 1,below of sequence-item3/output 2}
\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{-to}{sequence-item2/additional-module2}
\smartdiagramconnect{-to}{sequence-item3/additional-module3}
\end{document}
有没有办法对注释“输入”、“输出 1”和“输出 2”使用不同的填充颜色?
答案1
您可以colorseries
直接使用。例如:
\documentclass{article}
\usepackage[rgb]{xcolor}
\usepackage{tikz}
\usepackage{smartdiagram}
\usesmartdiagramlibrary{additions}
% xcolor manual: 34
\definecolorseries{colours}{hsb}{grad}[hsb]{.575,1,1}{.987,-.234,0}
\resetcolorseries[12]{colours}
\begin{document}
\centering
\smartdiagramset{
set color list={red!10, red!30,red!50},
sequence item border color=black,
sequence item text color=black,
sequence item border size=1.2\pgflinewidth,
sequence item font size=\scriptsize\sffamily,
additions={
additional item shape=rectangle,
additional item fill color=colours!!+!20,
additional item border color=colours!!,
additional arrow line width=2pt,
additional arrow tip=to,
additional arrow color=black,
additional item font=\scriptsize\sffamily,
}
}
\smartdiagramadd[sequence diagram]{step 1,step 2, step 3}
{above of sequence-item1/input,below of sequence-item2/output 1,below of sequence-item3/output 2}
\smartdiagramconnect{to-}{sequence-item1/additional-module1}
\smartdiagramconnect{-to}{sequence-item2/additional-module2}
\smartdiagramconnect{-to}{sequence-item3/additional-module3}
\end{document}