I’m going to walk you through editing @jaasso code snippet to do what you want.
The array that he has you can change into an array of type Color and rename it colors:
public Colors[] colors;
In the inspector, you would then choose the colors you want to cycle through, or you can populate this with code in the Start() function if you only want to use the 3 colors and never change them later. For now, I recommend just doing it in the inspector.
The int index is being used to identify which color in the array is going to keep track of the index we want to update the color to.
The Render is the component that holds the material. In his code, he is caching our GetComponent call in the Start() function so that all future references don’t cost us a look up call to find that component (we stored it in a local variable so we already have it found).
In his update function, you have the Input conditional statement checking to see if ‘R’ has been pressed. When it is pressed, we want to execute the code inside the {} braces.
index++;
if(index==materials.length)
index=0;
index (remember is the variable we use to track which color we want to change to) gets incremented here in this snippet with the ++. Then, the if condition checks to see if the index is the same length as the array variable we created. Remember, we are changing materials to colors, so we need to fix the name of the array.
“.length” returns the amount of variables in our colors array. We want to cycle through them, so when we get to the end we need to reset our index back to 0. That’s what the conditional is doing in his code.
renderer.material=materials[index];
This line changes the material. We need to update this line to just change the color of the existing material to the color from our colors array index. since our GetComponent is cached in the variable ‘renderer’ we can make appropriate use of it instead of what we were doing before.
renderer.material.color = colors[index];
See if you can piece all that together and show me what you come up with 
Regards,
Rob