Added check for colour
Merger with Tim's changes.