Move colour determination into discrete function.