Dynamically Change Node Colour
Often when want to organise your script or just see certain changes better on a large script
it can be useful to set some expressions so certain nodes would dynamically change colour.
​
This is a collection of some combinations that I found useful over the years.
​
Keep in mind that using these can make your script heavier as the GUI updates has to be interpreted and displayed. More codes mean more time to load images in the Viewer.
Therefore, it's always advised to balance readability with optimisation based on your needs!
​
If want to know more about tile_color values already done a deeper dive with some useful links here.
Switch
## This is a setup I found useful for Precomps. The Switch node is changing colour both depending on when it's on 0 or 1 and when it's disabled.
Which: [value which]
[if {[value this.disable]==false && [value this.which]==1} {return [knob this.tile_color 16711935]} {return [knob this.tile_color 4281270527]}]

## Not sure if this is practical, but it's sure very funky.
It sets a HEX value to your tile_color that maxes out on 255 as it's the highest value for the HEX colour palette.
[knob tile_color [value which]]
Merge
Merge and ChannelMerge has a dark blue tile colour. When I work in a large script it's often difficult to see when these crucial nodes are enabled or disabled.

In such cases I found these nodes easier to work with if they turn red when disabled:
[knob tile_color [ expr {[value disable]? 4278190335:0}]]

Here's a snippet to add it to all the Merge, ChannelMerge and MergeExpression nodes in your script:
If you want this expression to be added as a default to these nodes you can add the
following snippet to your menu.py:
Deep nodes

Deep nodes have probably the darkest default tile colour of all the nodes. I simply find it easier to apply the same treatment on them as on the Merge nodes to see better when they are disabled.
​
Here's a snippet to add this expression to all selected Deep nodes in your script:
If you want this expression to be added as a default to these nodes you can add the
following snippet to your menu.py:
Hope you will find it useful!
