Moved 'get tile color' if-statement into helper function