Fix color index overflow by reuse existed color in the vector. Fix #14293