def _hue_to_rgb(hue):
    """ Take hue between 0 and 1, return (r, g, b). """
    i = int(hue * 6.0)
    f = hue * 6.0 - i
    q = int(255 * (1.0 - f))
    t = int(255 * (1.0 - (1.0 - f)))
    i %= 6
    return [(255, t, 0), (q, 255, 0), (0, 255, t), (0, q, 255), (t, 0, 255),
        (255, 0, q)][i]
