I want to draw a stack of boxes in TikZ where the boxes get their color from a numbered list of colors. This question explains how to do a numbered list of colors with different colored text. I tried to use it in my solution, but I get the error from xcolor "undefined color". The colors in the list are defined and work fine outside of the script, it's the calling of the function that doesn't work.
The end goal here is to make the boxes like a stair, if you are wondering about some other remnants in the example. (full disclosure, I keep most of this in my own document class in different places so I am not entirely sure I copy-pasted all of the relevant code but it should be close to a MWE).
Minimum example (that currently doesn't work):
\documentclass{report}
\usepackage{xparse,xpatch,xcolor,tikz}
\usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings}
\usetikzlibrary{shapes.geometric, arrows}
\ExplSyntaxOn
\prop_new:N \g_aloui_colors_prop
\NewDocumentCommand{\setdocumentcolors}{m}
{
\prop_gset_from_keyval:Nn \g_aloui_colors_prop { #1 }
}
\NewDocumentCommand{\ovc}{m}
{
\prop_item:Nn \g_aloui_colors_prop { #1 }
}
\ExplSyntaxOff
\setdocumentcolors{
1=yellow,
2=orange,
3=red,
}
\begin{document}
\newcommand{\ovstair}[2]
{
\begin{tikzpicture}[
box/.style={
draw,
minimum height=1.3cm,
minimum width=\textwidth/#1,
text width=13cm
}
]
% Draw baseline
\node [minimum height=0cm, minimum width=\textwidth,fill=white] (boxName0) {};
% Draw steps
\foreach \bbt [count=\bbn from 1] in {#2}
{
\pgfmathsetmacro{\prevbox}{int(\bbn-1)};
\node [box,fill=\ovc{\bbn},above of= boxName\prevbox] (boxName\bbn) {\bbt};
}
\end{tikzpicture}
}
\ovstair{3}{
One,
Two,
Three,
}
\end{document}