set constructor for ColorWidget and TextWidget.