Mesh.colors doesn't work even though colors are passed correctly to the array

So iam creating a procedural terrain. The terrain is devided into chunks, which are instantiated in the Start function from a prefab. I am using a vertex color shader so that i can change the color of the meshe’s vertices. During play mode the tarrain is perfectly generated, (vertices, triangles, uvs, texture, and normals). I also create a list of Colors and assign it to the meshe’ s colors by typing:

mesh.colors = colors.ToArray();

No errors are showing in the editor on play mode, but the vertex colors do not change.
On the other hand,when debugging the mesh.colors content the vertex colors are exactly what i want them to be, meaning that they were passed in the array successfully.

Also keep in mind that the color list that i create contains colors of type “new Color(5,5,5,255)” and not for example.

SO, what am i doing wrong?
Thanks in advance!!

I created a new scene, created a cube, added the shader and a script to change vertex color. What i noticed was that when i set the mesh.colors array with a color of type the vertices change to black, but when i set it to new Color(5,5,5,255) it actually makes the vertices whiter!! Am i missing something here??

What you seem to do wrong here is that the Color struct uses float values in the range of 0 to 1, just like in the shader. If you want to specify your colors with byte ranges you should use the Color32 struct. It can be implicitly converted to Color or vice versa. Though a Color32 value is 4 times smaller that a Color value. The mesh has a seperate colors32 property which you may want to use instead.