I have to display several versions of the same object, with only the color changing. My first approach was to duplicate the mesh and add a different material to each.

My problem is: when I want to modify the mesh, I have to do it on each object separately. I tried to have different objects with the same mesh, but the color seems to be linked to the mesh and not to the object.

Is there a way (even programmatically) to have the same mesh in different objects with different colors?

Additionnal info:

I'm using Cycles and my material is a node material in which there is only one changing color.

Using three linked cubes (duplicated with AltD) with the same material as an example:

Note that this node setup is a lot cleaner and easier to manage when node groups are used.

Multiple materials:

By setting the material to link to that specific Object instead of it's data, which is shared by the other linked objects, you can have separate materials on separate objects which share the same mesh/data.