Refactor "dead colour" code using new constant
Create new COLOUR_* constants
Create new calculateAliveColour() function
Use calculateAliveColour() in main()