Different Layer Colours

Hi, I need to color nodes differently based on their position in the layer. (i.e) If a node placed in the first layer it should have green color, if it placed in second layer it should have red color ,for nodes in third layer a different color. Is there any way to achieve it. Thanks on advance

There are lots of ways to do so. For example, you could customize the layout to do it, as this sample does: https://gojs.net/latest/samples/orgcharteditor.html

Or you could implement various DiagramEvent listeners to update dropped or moved or copied nodes.