I'm pretty new to LaTex, so please forgive my sloppy code. I'm trying to create a table from a csv file, and pass a list of colors in so that LaTex will color each cell of the a column of the table differently depending on the corresponding element in the list. I can't get it to work. Any suggestions?
\documentclass{article}
\usepackage{pgfplotstable,filecontents}
\RequirePackage{listofitems}
\begin{filecontents*}{test.csv}
ColA, ColB, ColC
0.17, 0.91, 0.67
0.15, 0.17, 0.92
0.48, 0.1, 0.28
\end{filecontents*}
\begin{document}
\pgfplotstabletypeset[col sep=comma,
]{test.csv}
\def\mylistOne{green, blue, orange}
\readlist*\mylistTwo{\mylistOne}
\newcounter{myCounter}
\setcounter{myCounter}{-1}
\foreachitem\x\in\mylistTwo[]{
\stepcounter{myCounter}
\pgfplotstableset{
every row \themyCounter column 1/.style={
postproc cell content/.append style={
/pgfplots/table/@cell content/.add={\cellcolor{\x}}{},
}
}
}
}
\end{document}

