Applies a colormap to an ndarray