(h, s, v, alpha=1.0)
Converts a color given by its HSVA coordinates (hue, saturation,
    value, alpha) to RGB coordinates.

    Each of the HSVA coordinates must be in the range [0, 1].
Converts a color given by its HSVA coordinates (hue, saturation,
    value, alpha) to RGB coordinates.
Converts a color given by its HSVA coordinates ( hue saturation value alpha ) to RGB coordinates .
def hsva_to_rgba(h, s, v, alpha=1.0):
    """Converts a color given by its HSVA coordinates (hue, saturation,
    value, alpha) to RGB coordinates.

    Each of the HSVA coordinates must be in the range [0, 1].
    """
    # This is based on the formulae found at:
    # http://en.wikipedia.org/wiki/HSL_and_HSV
    c = v * s
    h1 = (h * 6) % 6
    x = c * (1 - abs(h1 % 2 - 1))
    m = v - c
    h1 = int(h1)
    if h1 < 3:
        if h1 < 1:
            return (c + m, x + m, m, alpha)
        elif h1 < 2:
            return (x + m, c + m, m, alpha)
        else:
            return (m, c + m, x + m, alpha)
    else:
        if h1 < 4:
            return (m, x + m, c + m, alpha)
        elif h1 < 5:
            return (x + m, m, c + m, alpha)
        else:
            return (c + m, m, x + m, alpha)
def hsva_to_rgba ( h , s , v , alpha = 1.0 ) : # This is based on the formulae found at: # http://en.wikipedia.org/wiki/HSL_and_HSV c = v * s h1 = ( h * 6 ) % 6 x = c * ( 1 - abs ( h1 % 2 - 1 ) ) m = v - c h1 = int ( h1 ) if h1 < 3 : if h1 < 1 : return ( c + m , x + m , m , alpha ) elif h1 < 2 : return ( x + m , c + m , m , alpha ) else : return ( m , c + m , x + m , alpha ) else : if h1 < 4 : return ( m , x + m , c + m , alpha ) elif h1 < 5 : return ( x + m , m , c + m , alpha ) else : return ( c + m , m , x + m , alpha )