def terrain(x):
    """Interpolate the noise value and return the terrain type.
    """
    if x <-1:
        return {"name": "deep water", "color": (0, 0, 100),}
    elif -1 <= x <= -0.5:
        return {"name": "water", "color": (0, 0, 180)}
    elif -0.5 < x <= -0.3: 
        return {"name": "shallow water", "color": (0, 0, 230)}
    elif -0.3 < x <= 0.1:
        return {"name": "beach", "color": (244, 164, 96)}
    elif 0.1 < x <= 0.4:
        return {"name": "grass", "color": (127, 255, 0)}
    elif 0.4 < x <= 1:
        return {"name": "forest", "color": (0, 128, 0)}
    else:
        #x > -1
        return {"name": "deep forest", "color": (0, 50, 0)}