You already asked a variation of this question
here[
^] and, as you have more context there, you should continue there. As I explained in my reply to you there, you need to use the index of the row and the index of the cell that you want to change colour for.
As you aren't showing anyone what you want your end state needs to be, you are going to have to work out what those indexes are for yourself. To be honest, that shouldn't be that difficult for you - all you need to do is step through the code and watch the values while you are doing it. This is straightforward debugging and shouldn't take you long to figure out for yourself, but you have to make the effort.