def _get_node_colors(nodes, path, colors):
    """For each node, assign color based on membership in path."""
    node_colors = []
    for x in nodes:
        if x in path:
            node_colors.append(colors['active'])
        else:
            node_colors.append(colors['inactive_node'])
    return node_colors