(color)
Return a color RGBA normalized coefficients from any of the following
    possible inputs:
      * (r, g, b) or (r, g, b, a) with r, g, b, a between 0 and 1.
      * a string with one of the following characters: rgbcymkw for the
        primary colors, and optionnaly a floating number between 0 and 1 for 
        the alpha channel, ie 'r.75' for red at 75%.
      * a string with an hexadecimal code.
      * a list of colors
Return a color RGBA normalized coefficients from any of the following
    possible inputs:
      * (r, g, b) or (r, g, b, a) with r, g, b, a between 0 and 1.
      * a string with one of the following characters: rgbcymkw for the
        primary colors, and optionnaly a floating number between 0 and 1 for 
        the alpha channel, ie 'r.75' for red at 75%.
      * a string with an hexadecimal code.
      * a list of colors
Return a color RGBA normalized coefficients from any of the following possible inputs : * ( r g b ) or ( r g b a ) with r g b a between 0 and 1 . * a string with one of the following characters : rgbcymkw for the primary colors and optionnaly a floating number between 0 and 1 for the alpha channel ie r . 75 for red at 75% . * a string with an hexadecimal code . * a list of colors
def get_color(color):
    """Return a color RGBA normalized coefficients from any of the following
    possible inputs:
      * (r, g, b) or (r, g, b, a) with r, g, b, a between 0 and 1.
      * a string with one of the following characters: rgbcymkw for the
        primary colors, and optionnaly a floating number between 0 and 1 for 
        the alpha channel, ie 'r.75' for red at 75%.
      * a string with an hexadecimal code.
      * a list of colors
    
    """
    if type(color) == int:
        color = get_next_color(color)
    if isinstance(color, basestring):
        color = color.lower()
        for pattern, fun in PATTERNS.iteritems():
            r = re.match(pattern, color)
            if r is not None:
                break
        return fun(color)
    elif type(color) is tuple:
        assert color
        if len(color) == 3:
            color = color + (1.,)
        assert len(color) == 4
        return color
    elif type(color) is list:
        assert color
        if color and (type(color[0]) != tuple) and (3 <= len(color) <= 4):
            color = tuple(color)
        return map(get_color, color)
    else:
        return color
def get_color ( color ) : if type ( color ) == int : color = get_next_color ( color ) if isinstance ( color , basestring ) : color = color . lower ( ) for pattern , fun in PATTERNS . iteritems ( ) : r = re . match ( pattern , color ) if r is not None : break return fun ( color ) elif type ( color ) is tuple : assert color if len ( color ) == 3 : color = color + ( 1. , ) assert len ( color ) == 4 return color elif type ( color ) is list : assert color if color and ( type ( color [ 0 ] ) != tuple ) and ( 3 <= len ( color ) <= 4 ) : color = tuple ( color ) return map ( get_color , color ) else : return color