def save_html(self, filename, whitebg=False):
        html = self.get_html(whitebg)
        try:
            f = open(filename, 'w')
            f.write(html)
            f.close()
            self.prnt('Theme exported as HTML to "%s"' % filename)
        except:
            self.prnt_error('Error writing HTML to "%s"' % filename)
            raise