'Return an array of colors corresponding to the values in *data*.
Data must be either a scalar position or an array (any shape) of positions.
The *mode* argument determines the type of data returned:
byte        (default) Values are returned as 0-255 unsigned bytes.
float       Values are returned as 0.0-1.0 floats.
qcolor      Values are returned as an array of QColor objects.'

def map(self, data, mode='byte'):

    if isinstance(mode, basestring):
        mode = self.enumMap[mode.lower()]
    if (mode == self.QCOLOR):
        (pos, color) = self.getStops(self.BYTE)
    else:
        (pos, color) = self.getStops(mode)
    if np.isscalar(data):
        interp = np.empty((color.shape[1],), dtype=color.dtype)
    else:
        if (not isinstance(data, np.ndarray)):
            data = np.array(data)
        interp = np.empty((data.shape + (color.shape[1],)), dtype=color.dtype)
    for i in range(color.shape[1]):
        interp[..., i] = np.interp(data, pos, color[:, i])
    if (mode == self.QCOLOR):
        if np.isscalar(data):
            return QtGui.QColor(*interp)
        else:
            return [QtGui.QColor(*x) for x in interp]
    else:
        return interp
