This is a continuation of a previous question: Draw a set of arrows using a palette of colors.
What I want
I want to draw multiple arrows starting from one node to more than one. Each arrow that starts in the same node must have the same color; but another node must have the following color (with its arrows of the same color), and so on.
You have to achieve the following in the most automatically possible way:
What I have done
This MWE is adapted for a better manipulation of the answer to that question:
\documentclass{article}
\usepackage{tikz}
\newcommand\totalnodes{5} % Define the total of nodes-1
\begin{document}
\begin{tikzpicture} % From https://tex.stackexchange.com/a/480466/152550
\foreach \X in {0,...,\totalnodes} {
\node[circle,draw,name=a\X] at (0,\X) {};
\node[circle,draw,name=b\X] at (1,\X) {};
% [actual node] * [0.75 (limits the final color to purple)] * 1/\totalsubjects
\pgfmathsetmacro{\huenum}{\X*0.75*(1/\totalnodes)}
\definecolor{mycolor}{hsb}{\huenum,1,1}
\draw[-latex,mycolor] (a\X) to (b\X);
}
\end{tikzpicture}
\end{document}
As you can see, I am not able to find an algorithm capable of adding more arrows that come from the same node.
My idea was to make a recursive algorithm that goes through some of the nodes in which I wanted to get the arrow, but I do not know how to jump from node 0
to 2
and then to 5
and so on.
For example, to start with something I tried to change \draw[-latex,mycolor] (a\X) to (b\X);
to \draw[-latex,mycolor] (a\X) to (b$\X-0$);
(new line) \draw[-latex,mycolor] (a\X) to (b$\X-1$);
(new line) \draw[-latex,mycolor] (a\X) to (b$\X-2$);
etc. but the compiler gives errors (as expected).
Thanks!!