He is adding the colors - using
ProceduralMesh->CreateMeshSection
Your way is just more code for the same thing.
Also your code snippets don’t mean jack:
No one can implement them without knowing what vertex is supposed to be.
Particularly without being sure that whatever Vertex is it has access to a definition of VertexColors.
vertex.VertexColors
Will error out if you initialize vertex with anything but the correct type.
You’ll notice there is no definition for vertex in the code above.
Vertices != vertex.
Even if you assume that the function inherits a definition of vertex, the code is still wrong, as he doesn’t assign the proper positions to it.