def convertColor(col,toint=True):
    """
    This function will convert a color array [r,g,b] from range 1-255 
    to range 0.-1 (vice/versa)
    
    @type  col: array
    @param col: the color [r,g,b]
    @type  toint: boolean
    @param toint: way of the convertion, if true convert to 1-255, if false
    convert to range 0-1
   
    @rtype:   array
    @return:  the converted color [0-1.,0-1.,0-1.] or [1-255,1-255,1-255]
    """

    if toint and max(col)<=1.0: col = map( lambda x: x*255, col)
    elif not toint and max(col)>1.0: col = map( lambda x: x/255., col)
    return col