def _rgb2hsl(rgb):
    """Create HSL from an RGB integer"""
    r = ((rgb >> 16) & 0xFF) / 255
    g = ((rgb >> 8) & 0xFF) / 255
    b = (rgb & 0xFF) / 255
    min_c = min(r, g, b)
    max_c = max(r, g, b)
    delta_c = max_c - min_c
    l = min_c + (delta_c / 2)
    h = 0
    s = 0
    if max_c != min_c:
        if l > 0.5:
            s = delta_c / (2 - max_c - min_c)
        else:
            s = delta_c / (max_c + min_c)
        if max_c == r:
            h = (g - b) / delta_c
            if g < b:
                h += 6
        elif max_c == g:
            h = ((b - r) / delta_c) + 2
        else:
            h = ((r - g) / delta_c) + 4
        h /= 6
    return (h, s, l)