def _colorize(heatmap, colormap):
    """
    Apply the ``colormap`` function to a grayscale 
    rank 2 ``heatmap`` array (with float values in interval [0, 1]).
    Returns an RGBA rank 3 array with float values in range [0, 1].
    """
    heatmap = colormap(heatmap)
    return heatmap
