import six


def hex2color(s):
    """
    Take a hex string *s* and return the corresponding rgb 3-tuple
    Example: #efefef -> (0.93725, 0.93725, 0.93725)
    """
    if not isinstance(s, six.string_types):
        return s
    return tuple([int(n, 16) / 255.0 for n in (s[1:3], s[3:5], s[5:7])])