created nextColor() method to iterate the array of colors