levelColors - How to display nodes in the same hierarchy/Level with different colors

In the above diagram, level 2 - how to change the node 2 color to gray (based on condition). How to display nodes on same level with different colors based on some specific condition?

var levelColors = ["#F04F9F", “#377BB9”];

// override TreeLayout.commitNodes to also modify the background brush based on the tree depth level
myDiagram.layout.commitNodes = function() {
go.TreeLayout.prototype.commitNodes.call(myDiagram.layout); // do the standard behavior
// then go through all of the vertexes and set their corresponding node’s Shape.fill
// to a brush dependent on the TreeVertex.level value
myDiagram.layout.network.vertexes.each(function(v) {
if (v.node) {
var level = v.level % (levelColors.length);
var color = levelColors[level];
var shape = v.node.findObject(“SHAPE”);
if (shape) shape.fill = goJS(go.Brush, “Linear”, { 0: color, 1: go.Brush.lightenBy(color, 0.05), start: go.Spot.Left, end: go.Spot.Right });
}
});
};

That depends on what the condition is. A general approach is to use a Binding on the Shape.fill. Please read GoJS Data Binding -- Northwoods Software. Then you might not need that override of TreeLayout.commitNodes.