Optimising getColour code