'Parameters
X : scalar, ndarray
The data value(s) to convert to RGBA.
For floats, X should be in the interval ``[0.0, 1.0]`` to
return the RGBA values ``X*100`` percent along the Colormap line.
For integers, X should be in the interval ``[0, Colormap.N)`` to
return RGBA values *indexed* from the Colormap with index ``X``.
alpha : float, None
Alpha must be a scalar between 0 and 1, or None.
bytes : bool
If False (default), the returned RGBA values will be floats in the
interval ``[0, 1]`` otherwise they will be uint8s in the interval
``[0, 255]``.
Returns
Tuple of RGBA values if X is scalar, othewise an array of
RGBA values with a shape of ``X.shape + (4, )``.'

def __call__(self, X, alpha=None, bytes=False):

    if (not self._isinit):
        self._init()
    mask_bad = None
    if (not cbook.iterable(X)):
        vtype = u'scalar'
        xa = np.array([X])
    else:
        vtype = u'array'
        xma = np.ma.array(X, copy=True)
        mask_bad = xma.mask
        xa = xma.filled()
        del xma
    if (not xa.dtype.isnative):
        xa = xa.byteswap().newbyteorder()
    if (xa.dtype.kind == u'f'):
        vals = np.array([1, 0], dtype=xa.dtype)
        almost_one = np.nextafter(*vals)
        np.copyto(xa, almost_one, where=(xa == 1.0))
        xa *= self.N
        np.clip(xa, (-1), self.N, out=xa)
        np.copyto(xa, (-1), where=(xa < 0.0))
        xa = xa.astype(int)
    np.copyto(xa, self._i_over, where=(xa > (self.N - 1)))
    np.copyto(xa, self._i_under, where=(xa < 0))
    if (mask_bad is not None):
        if (mask_bad.shape == xa.shape):
            np.copyto(xa, self._i_bad, where=mask_bad)
        elif mask_bad:
            xa.fill(self._i_bad)
    if bytes:
        lut = (self._lut * 255).astype(np.uint8)
    else:
        lut = self._lut.copy()
    if (alpha is not None):
        alpha = min(alpha, 1.0)
        alpha = max(alpha, 0.0)
        if bytes:
            alpha = int((alpha * 255))
        if (lut[(-1)] == 0).all():
            lut[:(-1), (-1)] = alpha
        else:
            lut[:, (-1)] = alpha
    rgba = np.empty(shape=(xa.shape + (4,)), dtype=lut.dtype)
    lut.take(xa, axis=0, mode=u'clip', out=rgba)
    if (vtype == u'scalar'):
        rgba = tuple(rgba[0, :])
    return rgba
