def get_value(state: dict, key: str):

    """
    get the value of a given key in the state
    :param state: the dict
    :param key: key, can be a path like color/r
    :return: the value if found or None
    """
    k = key.split("/", 1)
    if len(k) > 1:
        if k[0] not in state:
            return None
        else:
            return get_value(state[k[0]], k[1])
    else:
        if key in state:
            return state[key]
        return None