Having a trouble to read vertex colors of mesh exported from blender to unity

Hi. Im currently trying to read vertex colors from a mesh exported from blender to unity .
This is a screenshot of the mesh with standrad vertex colors material shader.

As you can see, there are only 3 colors - red, white and blue.
My goal is to get info of which vertices have certain vertex color using “Mesh.colors” array

but the problem is it doesnt read mesh’s vertex colors well!

there are total 2891 vertices and vertex colors in this mesh, but unity says there are only two white vertex colors in this mesh! I tried both mesh.colors and mesh.colors32 and it was same result.

then I tried to change all vertices color of mesh with redfor a test to check if I did any thing wrong, with codes below.

List<Color> w_colors=new List<Color>();
        w_colors.AddRange(Enumerable.Repeat(Color.red,mesh.colors.Length));
        mesh.SetColors(w_colors);  

And then I got count of all vertices’ colors with red(2891) in both scene view and console

Is there anything I did wrong?

How are determining whether the pixel is white or not? What if instead of white (1,1,1) you have an almost white like (0.99999,0.99999,0.99999)?

Cause I created vertex color file of the mesh in blender with only 3 colors-red, white and blue.

Behind the scenes It’s actually a long, bumpy road to get from Blender to Unity and lots of things can happen. You should use Debug.Log to see what you actually have in your mesh. Make sure you use some good string formatting so it doesn’t round or truncate what is being displayed.