def rgb2html(rgb, alpha=None):
    """
    method will convert given rgb tuple to html representation
    rgb(R, G, B)
    if alpha is set, it will be included
    rgb(R, G, B, )
    """
    if alpha is not None:
        return 'rgba({0:d}, {1:d}, {2:d}, {3:s})'.format(*rgb, alpha if
            isinstance(alpha, str) else '%1.2f' % float(alpha))
    return 'rgb({0:d}, {1:d}, {2:d})'.format(*rgb)
