OfSetColor trouble!

Hello, I am trying to create a colour generator by using ofGetFrameNum() however, the colour stops at white which nothing shows. Is there any way the colour keeps printing?

This is the code:

void ofApp::update(){

 ofSetColor(10+ofGetFrameNum()/10,20+ofGetFrameNum()/20,10+ofGetFrameNum()/15);

}

thanks! :blush:

white: 255,255,255 is the max value for colors so you need to loop around 255:

int r = (10+ofGetFrameNum()/10) % 255;
int g = (20+ofGetFrameNum()/20) % 255;
int b = (10+ofGetFrameNum()/15) % 255;
 ofSetColor(r,g,b);

Thank you so much! it worked perfect! :blush: