def METHOD_NAME(h, s, v):
    """Converts HSV to RGB.
    Based on the Foley and Van Dam HSV algorithm used
    by James Westervelt's (CERL) hsv.rgb.sh script from GRASS 4/5."""
    # Hue: 0-360 degrees
    # Saturation: 0.0-1.0
    # Value: 0.0-1.0
    if v == 0.0:
        return (0, 0, 0)
    if v == 1.0:
        return (255, 255, 255)
    if h >= 360:
        h -= 360
    h = h / 60.0
    i = int(h)
    f = h - i
    p = v * (1 - s)
    q = v * (1 - s * f)
    t = v * (1 - s * (1 - f))
    # init/fallback
    R = G = B = 0
    # red
    if i == 0:
        R = v
    if i == 1:
        R = q
    if i == 2:
        R = p
    if i == 3:
        R = p
    if i == 4:
        R = t
    if i == 5:
        R = v
    # green
    if i == 0:
        G = t
    if i == 1:
        G = v
    if i == 2:
        G = v
    if i == 3:
        G = q
    if i == 4:
        G = p
    if i == 5:
        G = p
    # blue
    if i == 0:
        B = p
    if i == 1:
        B = p
    if i == 2:
        B = t
    if i == 3:
        B = v
    if i == 4:
        B = v
    if i == 5:
        B = q
    return (R * 255, G * 255, B * 255)