8

I'm drawing this:

enter image description here

How can I remove the gradient in the background of each node? I want to set a solid color for each element.

Code for the above example:

\documentclass{article}
\usepackage{smartdiagram}

\begin{document}

\tikzset{
  every shadow/.style={
    fill=none,
    shadow xshift=0pt,
    shadow yshift=0pt}
}
\smartdiagramset{
  module shape=rectangle,
  uniform arrow color=true,
  uniform color list=teal!60 for 5 items,
  arrow color=gray!50!black,
  back arrow distance=0.75cm,
  module y sep=2cm,
  module minimum width=4cm,
  text width=4cm,
  border color=none
}
\smartdiagram[flow diagram]{
  a,
  b,
  c,
  d,
  e
}

\end{document}
0

2 Answers 2

9

The answer proposed by @Christian Hupfer works great but is limited to one color. In the source code of the smartdiagram package, the current color is referenced as \col. Hence, the following code allows the use the set color list parameter:

\tikzset{module/.append style={top color=\col,bottom color=\col}}

The resulting code creates a diagram without gradient inside the nodes but with the chosen colors as @L42 requested.

diagram without color gradient


\documentclass{article}
\usepackage{smartdiagram}
\begin{document}


\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,
  uniform arrow color=true,
  set color list={red!10, blue!30, blue!30, blue!30, green!40},
  arrow color=gray!50!black,
  back arrow distance=0.75cm,
  module y sep=2cm,
  module minimum width=4cm,
  text width=4cm,
  border color=none,
}
\smartdiagram[flow diagram]{
  a,
  b,
  c,
  d,
  e
}

\end{document}
3

One way is to use the module./style= option, but appending the top color and bottom color to have the same value.

The backdraw is that you've have to specify again the colors.

\documentclass{article}
\usepackage{smartdiagram}
\begin{document}


\tikzset{
  every shadow/.style={
    fill=none,
    shadow xshift=0pt,
    shadow yshift=0pt}
}

\tikzset{module/.append style={top color=teal!60,bottom color=teal!60}}
\smartdiagramset{
  module shape=rectangle,
  uniform arrow color=true,
  uniform color list=teal!60 for 5 items,
  arrow color=gray!50!black,
  back arrow distance=0.75cm,
  module y sep=2cm,
  module minimum width=4cm,
  text width=4cm,
  border color=none,
}
\smartdiagram[flow diagram]{
  a,
  b,
  c,
  d,
  e
}

\end{document}
6
  • Thank you. This works for what I had in mind, but can I use this approach if I need multiple colors?
    – L42
    Apr 18, 2016 at 12:45
  • @L42: Hm, unsure -- which colours do you want to modify?
    – user31729
    Apr 18, 2016 at 14:17
  • Say I want a, b and c to be teal and the rest be blue?
    – L42
    Apr 19, 2016 at 6:40
  • @L42: I'll take a lot (and sorry for the late response!)
    – user31729
    Apr 19, 2016 at 20:39
  • I'll have no clue for this yet
    – user31729
    Apr 25, 2016 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .