(color)
return "#{0:02X}{1:02X}{2:02X}".format(*color)
Formats a color given as a 3-tuple or 4-tuple in HTML format.

    The HTML format is simply given by C{#rrggbbaa}, where C{rr} gives
    the red component in hexadecimal format, C{gg} gives the green
    component C{bb} gives the blue component and C{gg} gives the
    alpha level. The alpha level is optional.
Formats a color given as a 3-tuple or 4-tuple in HTML format.
Formats a color given as a 3 - tuple or 4 - tuple in HTML format .
def color_to_html_format(color):
    """Formats a color given as a 3-tuple or 4-tuple in HTML format.

    The HTML format is simply given by C{#rrggbbaa}, where C{rr} gives
    the red component in hexadecimal format, C{gg} gives the green
    component C{bb} gives the blue component and C{gg} gives the
    alpha level. The alpha level is optional.
    """
    color = [int(clamp(component * 256, 0, 255)) for component in color]
    if len(color) == 4:
        return "#{0:02X}{1:02X}{2:02X}{3:02X}".format(*color)
    return "#{0:02X}{1:02X}{2:02X}".format(*color)
def color_to_html_format ( color ) : color = [ int ( clamp ( component * 256 , 0 , 255 ) ) for component in color ] if len ( color ) == 4 : return "#{0:02X}{1:02X}{2:02X}{3:02X}" . format ( * color ) return "#{0:02X}{1:02X}{2:02X}" . format ( * color )