def hex_from_rgba(rgba): """Translate color from Gdk.RGBA to html hex format""" return "#%02X%02X%02X" % tuple([int(getattr(rgba, name) * 255) for name in ("red", "green", "blue")])