def METHOD_NAME(var, arr, colormap):
    """
    ** This code was lightly edited for clarity and correctness from:
    https://github.com/WikiWatershed/model-my-watershed/issues/2122
    **
    Normalize raster values around display values ranges and convert
    to segmented linear interpolated rgba values for rendering
    """
    values = {
        'tmean': {
            'min': 0,
            'max': 60
        },
        'ppt': {
            'min': 0,
            'max': 500
        },
        'evi': {
            'min': 0,
            'max': 10000
        }
    }
    if var == 'tmean':
        arr = arr + 20
    else:
        arr = arr - values[var]['min']
    # Clean data layer of low or missing data
    cleaned_layer = np.ma.masked_where(arr < 0, arr)
    cleaned_layer = np.ma.masked_where(np.isnan(cleaned_layer), cleaned_layer)
    # Normalizing data to make it 0-1
    normed = cleaned_layer / float((values[var]['max'] - values[var]['min']))
    # Converting np array to rgba values of 0-255
    return colormap(normed, bytes=True)