BFS. replace color from near to far