In the following diagram
I would like to assign colors to the rectangles in each layer with colors from around a color wheel so that the colors in adjacent layers are separated by 144 degrees. For context $b_{1}b_{2}b_{3}b_{4}b_{5}$
is a string of elements from a Boolean algebra. The horizontal position indicates the "location" of the element. Here is the code
\documentclass[paper=letter,fontsize=12pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{amssymb}
\usepackage{mathtools}
\begin{document}
\begin{tikzpicture}
\node (b1) at (-1.0, 0.25) {$b_{1}$};
\node (b2) at (-1.0, 0.75) {$b_{2}$};
\node (b3) at (-1.0, 1.25) {$b_{3}$};
\node (b4) at (-1.0, 1.75) {$b_{4}$};
\node (b5) at (-1.0, 2.25) {$b_{5}$};
\draw (0, 0) -- ( 3.5, 0);
\fill[blue!50!white] (0, 0) rectangle (1.0, 0.5);
\fill[green!50!white] (1.5, 0.5) rectangle (2.5, 1.0);
\fill[red!50!white] (0.75, 1.0) rectangle (1.75, 1.5);
\fill[red!50!white] (3.0, 1.0) rectangle (3.5, 1.5);
\fill[purple!50!white] (0.75, 1.5) rectangle (1.5, 2.0);
\fill[yellow!50!white] (0.75, 2.0) rectangle (1.5, 2.5);
\end{document}
If there is a better method for accomplishing this task, feel free to mention it.
ninecolors
? You could also use thehsb
model from thexcolor
package and for each step increase the hue by, for example 10 degrees.