In my thesis, I have 'thumbs' on the sides of the page, i.e. the little blocks with the chapter number, which will be visible from the side. The thumb of each subsequent chapter is placed a bit lower than the previous. The script for this I got online. Now I'd like to also change the color gradually from light to dark with increasing chapter number. How can I make that happen automatically?
The part of the script that makes the thumbs looks as follows:
\definecolor{julia-green}{RGB}{67,182,75}
%% The lthumb command prints the current chapter number in a thumb index on the
%% left (even) page.
\newcommand*\lthumb{%
\ifthumb%
\begin{tikzpicture}[remember picture,overlay]
\coordinate (top margin) at (0pt,1in+\topmargin+\headheight+\headsep);
\coordinate (left margin) at (1.1in+\evensidemargin,0pt);
%% Calculate the corners of the thumb index based on the current
%% chapter number.
\coordinate (top left) at ($(current page.north west)-(top margin)-(0pt,\value{chapter}\thumbvspace-\thumbvspace)$);
\coordinate (bottom right) at ($(top left)+(left margin)-(\thumbhspace,\thumbheight)$);
%% Shift the left edge to prevent the rounded corner from showing.
\coordinate (top left) at ($(top left)-(\thumbedge,0pt)$);
%% Draw the thumb index.
\colorlet{thumb2}{julia-green}
\fill[fill=thumb2,rounded corners=\thumbedge](top left) rectangle (bottom right);
%% Print the chapter number at the center right in the thumb index.
\coordinate (center right) at ($(bottom right)+(0pt,0.5\thumbheight)$);
\node at (center right)[anchor=east,inner sep=2\thumbedge]{
\titlefont\bfseries\color{tudelft-white}
\fontsize{0.75\thumbheight}{0.75\thumbheight}\selectfont
\thechapter
};
\end{tikzpicture}%
\fi%
}
I've tried adding something like
\definecolor{julia-green}{RGB}{67,182,$\value{chapter}$}
before the
\colorlet{thumb2}{julia-green}
command, but this gives an error.
MWEfrom\documentclassto\end{document}– MadyYuvi Apr 21 '22 at 15:23