Tweaked colour extraction logic.