Array question (animate fills)
in
Programming Questions
•
2 years ago
I have an array question! I'm trying to array of a set of hex numbers so I can animate through them. This is what I have so far:
int numFrames = 6;
int frame = 0;
color[] myfill = new color[numFrames];
void setup(){
size(640,480);
frameRate(12);
myfill[0] = #B8529D;
myfill[1] = #E91D2D;
myfill[2] = #F27C2F;
myfill[3] = #3C55A1;
myfill[4] = #6BBE52;
myfill[5] = #F3EA43;
}
void draw(){
frame++;
if (frame == numFrames){
frame = 1;
}
noStroke();
color(myfill[frame]);
rect(0,0,640,480);
}
Not sure what I'm doing wrong.. it's seems like it's getting stuck on the first color.. Does this make sense? I'm trying to display these fills in order.. Thanks
1