def get_color_from_cmap(val, val_min, val_max, cmap):
    """Return color.

    Args:
        val (float): value to get color for from colormap (mV)
        val_min (int): minimum value of voltage for colormap (mV)
        val_max (int): minimum value of voltage for colormap (mV)
        cmap (matplotlib.colors.Colormap): colormap

    Returns:
        tuple: tuple of RGBA values indicating a color
    """
    if val_min >= val_max:
        return "black"
    val_range = val_max - val_min
    return cmap((min(max(val, val_min), val_max) - val_min) / (val_range))