Decoding color codes by projection onto surface codes