Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Created March 15, 2020 19:38
Show Gist options
  • Save moebiussurfing/6e8e13337db5a76e74d44b7a3ff4888f to your computer and use it in GitHub Desktop.
Save moebiussurfing/6e8e13337db5a76e74d44b7a3ff4888f to your computer and use it in GitHub Desktop.
openFrameworks - simplel color param listener
in ofApp.h
ofParameter<ofColor> color;
void updateModel(ofColor&);
ofEventListener colorListener;
ofApp.cpp
void ofApp::setup(){
//.....
gui.add(color.set("color", ofColor(255,0,0,255), ofColor(0,0,0,0), ofColor(255,255,255,255) ));
colorListener = color.newListener(this, &ofApp::updateModel);
//.....
}
void ofApp::updateModel(ofColor& c){
//update your model
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment