def colour(contents, colour): """ Add colour to the given contents. 'contents' is a widget or panel to colour, and 'colour' is the HTML colour code (eg, "#808080", etc) to use for the background colour. We returned the given contents wrapped in a Panel which has the given background colour attached. """ wrapper = VerticalPanel() wrapper.add(contents) DOM.setStyleAttribute(wrapper.getElement(), "background-color", colour) return wrapper