The base class drawing a widget background. The base class simply draws
a solid rectangle of given color, with an optional border. Subclasses may be
assigned to theme["bg"] or directly to a widget instance
to draw fancier backgrounds.
Constructor
function init(color, borderColor=null)
Initialize a new background.
Parameters: color – the solid background color.
borderColor – the borderColor, null for no border.
Check whether this background is (partially) transparent, i.e. lets shine
through parts of the parent widget.
function isTransparent()
Check whether this background is (partially) transparent, i.e. lets shine
through parts of the parent widget. The default implementation returns
false.
Returns:true if this background is transparent.
function draw(w, h, inset)
Draw the background into the rectangle [0, 0, w, h].
Parameters: w – the rectangle width.
h – the rectangle height.
inset – the content inset
["bg"]or directly to a widget instance to draw fancier backgrounds.