Fixed colour calculation bug.