def toggle_legend_collapse(_, is_open):
    """Open or close legend view.

    :param _: Toggle legend btn was clicked
    :param is_open: Current visibility of legend
    :return: New visbility for legend; opposite of ``is_open``
    :rtype: bool
    """
    return not is_open