I want to draw boxes with same color code and font like those used in the smartdiagram package. Can someone help provide some hint in doing this. See the diagram.
1 Answer
This answer will show you how to find the information you ask for in the sources (for v0.3b, dated 2016/12/23, distributed with TL2018).
Firstly look at the style file which says (only relevant content for you):
\usesmartdiagramlibrary{core.definitions}
\usesmartdiagramlibrary{core.styles}
\usesmartdiagramlibrary{core.commands}
So you have to search the three library files. You will be able to spot the following relevant definitions. So starting with the colors:
\@namedef{color@1}{red!40}
\@namedef{color@2}{cyan!40}
\@namedef{color@3}{blue!40}
\@namedef{color@4}{green!40}
\@namedef{color@5}{orange!40}
\@namedef{color@6}{yellow!40}
\@namedef{color@7}{magenta!40}
\@namedef{color@8}{brown!40}
\@namedef{color@9}{violet!40}
\@namedef{color@10}{teal!40}
And this describes your diagram:
\begin{tikzpicture}[every node/.style={align=center,let hypenation}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
\IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
\path let \n1 = {int(0-\xi)}, \n2={0+\xi*\sm@core@modulexsep} in
node[module,drop shadow] (module\xi) at +(\n2,0) {\smitem};
}{% false-horizontal-flow diagram
\path let \n1 = {int(0-\xi)}, \n2={0-\xi*\sm@core@moduleysep} in
node[module,drop shadow] (module\xi) at +(0,\n2) {\smitem};
}
}%
% arrows omitted
\end{tikzpicture}
Hence you will see that you need
\tikzset{module/.style={%
\pgfkeysvalueof{/smart diagram/module shape},
thick,
draw=\sm@core@bordercolor,
top color=white,
bottom color=\col,
text=\sm@core@textcolor,
text width=\sm@core@moduletextwidth,
minimum width=\sm@core@modulewidth,
minimum height=\sm@core@moduleheight,
font=\sm@core@modulefontsize,
\sm@core@borderdecoration
},
% arrows omitted
}