Change auto-colouring for root node.

The old method for generating a colour wasn't working because the root
node has no parent.