How to change UI attributes (like background color) of ofParameter<int>?


#1

When I create an ofxPanel and add an ofParamter<int>, how can I change the appearance of that slider - the way I can with ofxIntSlider? For example setBackgroundColor, setFillColor, etc.


#2
int guiWidth = 300;
gui_Cyls.setDefaultWidth(guiWidth);
	gui_Cyls.setDefaultHeight(15);
	gui_Cyls.setWidthElements(guiWidth);
	gui_Cyls.setDefaultWidth(guiWidth);
	gui_Cyls.setDefaultHeight(30);
	gui_Cyls.setWidthElements(300);
	gui_Cyls.setDefaultTextPadding(35);
	gui_Cyls.setDefaultBorderColor(ofColor::orange); //color name
	gui_Cyls.setDefaultHeaderBackgroundColor(ofColor(255, 0, 0)); //rgb
	gui_Cyls.setDefaultFillColor(ofColor(255, 0, 0));
	gui_Cyls.setDefaultBackgroundColor(ofColor(16));//greys
	gui_Cyls.setDefaultTextColor(ofColor(255));

//...

gui_Cyls.setup("CONTROL"); // most of the time you don't need a name but don't forget to call setup
	gui_Cyls.setName("CONTROL");

	//add widgets
//...

#3

Thanks. I’d like to change the background colour of the sliders manually at different times during execution.

For example, when adjusting slider1, sometimes I want the background of slider2 to become red depending on the value selected in slider1. I can do this easily with ofxIntSlider, since it has the function setBackgroundColor, but I don’t know where or how to do this if I change the slider’s type from ofxIntSlider to ofParamater<int>.