2

After trying to answer this question, and while I am pretty sure multiple things can be improved, the only point that I feel is still missing is the blurred shadow inside the circles and the bar in the picture below.

enter image description here enter image description here

After searching a bit, it seems that there are no much questions about such internal shadows or border shadows.

Here is what I've come up with so far for the circles, but it is really messy and the result of multiples tweaks.

\documentclass[tikz]{standalone}
\usetikzlibrary{calc,patterns.meta,shadows,shadows.blur}
% Definition of custom colors based on the initial figure of the bar by the OP
\definecolor{myblue}{HTML}{57AED1}

% Definition of custom tikz styles in order to ease readability
\tikzset{
    % Node style (Arguments : color, section number)
    sectionnode/.style={
        fill=#1,
        draw=none,
        thick,
        circle,
        text=white,
        radius=10pt,
        },
    shadowed/.style={
        preaction={transform canvas={shift={(0.2pt,-0.2pt)}},draw=myblue!50!black},
        preaction={transform canvas={shift={(0.4pt,-0.4pt)}},draw=myblue!60!black},
        preaction={transform canvas={shift={(0.6pt,-0.6pt)}},draw=myblue!70!black},
        preaction={transform canvas={shift={(0.8pt,-0.8pt)}},draw=myblue!80!black},
        preaction={transform canvas={shift={(1.0pt,-1.0pt)}},draw=myblue!90!black}},
}

\begin{document}
    \begin{tikzpicture}[]
    \path[clip] (0,0) circle (9.2pt);
    \node[sectionnode=myblue] at (0,0) {1};
    \path[shadowed] (0,0) circle (9pt);
    \draw[black] (0,0) circle (9pt);
    \end{tikzpicture}

\end{document}

enter image description here

I also tried some stuff using the shadows.blur library, but it does not seem to be possible to use it for this.

So my question is : could someone propose a node style / path style that could reproduce this shadow effect without using multiple \path and or clips.

1

Well I guess I found it myself this time.

Based on this answer by Andrew Stacey, I managed to regroup everything in a style using preactions and postactions and voilà !

\documentclass[tikz]{standalone}
\usetikzlibrary{calc,patterns.meta,shadows,shadows.blur}
% Definition of custom colors based on the initial figure of the bar by the OP
\definecolor{myblue}{HTML}{57AED1}

% Definition of custom tikz styles in order to ease readability
\pgfmathsetmacro{\blurshift}{0.15}
\pgfmathsetmacro{\blurwidth}{0.3}
% From https://tex.stackexchange.com/a/24957/141947
\tikzset{
  repeated postaction/.style={%
    repeat postaction/.list={#1}
  },
  repeat postaction/.code args={#1/#2}{\tikzset{postaction={transform canvas={shift={(\blurshift*#1 pt,-\blurshift*#1 pt)}},draw=myblue!#2!black,line width={\blurwidth pt}}}},
    % Node style (Arguments : color, section number)
    sectionnode/.style={fill=#1,draw=white,thick,circle,text=white,radius=10pt},
    shadowed/.style={circle,text=white,clip,
        preaction={sectionnode=myblue},
        postaction={repeated postaction={1/50,2/55,3/60,4/65,5/70,6/75,7/80,8/85,9/90,10/95}},
        postaction={sectionnode=none},
    }
}

\begin{document}
    \begin{tikzpicture}[]
    \node[shadowed] at (0,0) {1};
    \end{tikzpicture}

\end{document}

enter image description here

EDIT Here is an updated capable of handling the dashed bars. The major change here is that to account for the dashed lines, you have to reduce obacity of the shadows.

\documentclass[tikz]{standalone}
\usetikzlibrary{calc,patterns.meta,shadows,shadows.blur}
% Definition of custom colors based on the initial figure of the bar by the OP
\definecolor{myblue}{HTML}{57AED1}

% Definition of custom tikz styles in order to ease readability
\pgfmathsetmacro{\blurshift}{0.15}
\pgfmathsetmacro{\blurwidth}{0.3}
% From https://tex.stackexchange.com/a/24957/141947
\tikzset{
  repeated postaction/.style={%
    repeat postaction/.list={#1}
  },
  repeat postaction/.code args={#1/#2}{\tikzset{postaction={transform canvas={shift={(\blurshift*#1 pt,-\blurshift*#1 pt)}},opacity=0.5,draw=myblue!#2!black,line width={\blurwidth pt}}}},
    % Node style (Arguments : color, section number)
    sectionnode/.style={fill=#1,draw=white,thick,circle,text=white,radius=10pt},
    shadowednode/.style={circle,text=white,clip,
        preaction={sectionnode=myblue},
        postaction={repeated postaction={1/50,2/55,3/60,4/65,5/70,6/75,7/80,8/85,9/90,10/95}},
        postaction={sectionnode=none},
    },
    sectionbar/.style={preaction={fill=#1,draw=white,thick,rounded corners=2pt},pattern={Lines[angle=45,distance={6pt},line width=3pt]},pattern color=#1!70},
    shadowedbar/.style={rounded corners=2pt,clip,
        preaction={sectionbar=myblue},
        postaction={repeated postaction={1/50,2/55,3/60,4/65,5/70,6/75,7/80,8/85,9/90,10/95}},
        postaction={draw=white,thick},
    }
}

\begin{document}
    \begin{tikzpicture}[]
    \node[shadowednode] at (0,0) {1};

    \draw[draw=none,shadowedbar] (-3,-0.5) rectangle (3,-0.65);
    \end{tikzpicture}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.