diff --git a/src/components/ofxDatGuiColorPicker.h b/src/components/ofxDatGuiColorPicker.h index e47996f..5903566 100644 --- a/src/components/ofxDatGuiColorPicker.h +++ b/src/components/ofxDatGuiColorPicker.h @@ -75,18 +75,21 @@ class ofxDatGuiColorPicker : public ofxDatGuiTextInput { { mColor = color; setTextFieldInputColor(); + gColors[2] = mColor; + gColors[0] = ofColor(mColor.r/2, mColor.g/2, mColor.b/2); + vbo.setColorData(&gColors[0], 6, GL_DYNAMIC_DRAW ); } - + void setColor(int hex) { mColor = ofColor::fromHex(hex); - setTextFieldInputColor(); + setColor(mColor); } - + void setColor(int r, int g, int b, int a = 255) { mColor = ofColor(r, g, b, a); - setTextFieldInputColor(); + setColor(mColor); } ofColor getColor() diff --git a/src/components/ofxDatGuiGroups.h b/src/components/ofxDatGuiGroups.h index 2c0c8ed..012135c 100644 --- a/src/components/ofxDatGuiGroups.h +++ b/src/components/ofxDatGuiGroups.h @@ -484,6 +484,18 @@ class ofxDatGuiDropdown : public ofxDatGuiGroup { return children.size(); } + void setOptions(const vector& options = vector()) + { + mOption = 0; + children.clear(); + for(int i=0; isetIndex(children.size()); + opt->onButtonEvent(this, &ofxDatGuiDropdown::onOptionSelected); + children.push_back(opt); + } + } + ofxDatGuiDropdownOption* getChildAt(int index) { return static_cast(children[index]);