I'm creating a (10 bar) bar graph inside a 'for' loop, and want to 'fill' each bar in a different colour from an indexed list (or array) of RGB colours. I'm sure it must be possible, but everything I've tried has failed. :(
Does anyone know how this could be done?
To help it make sense, this is the size statement: size(600,200);
Here's the 'for' loop:-
for(Index=0;Index<10;Index++)
{
InBuffer[Index]=MyPort.read();
fill(<*indexed RGB value*>);
rect(Index*60,200,60,-InBuffer[Index]);
}
(This is my first 'real' sketch.)
Thanks in advance, guys.