The setBgColor method sets the background color of the widget to the specified one.
widget.setBgColor(color);