def clear(self, colour):
        """Clears background of the Drawer and fills with specified colour."""
        if self.ctx is None:
            self._reset_surface()
        self.ctx.save()

        # Erase the background
        self.clear_rect()

        # Fill drawer with new colour
        self.ctx.set_operator(cairocffi.OPERATOR_SOURCE)
        self.set_source_rgb(colour)
        self.ctx.rectangle(0, 0, self.width, self.height)
        self.ctx.fill()

        self.ctx.restore()
Clears background of the Drawer and fills with specified colour.
libqtile/backend/base/drawer.py