glsl - object color as input for coded shaders

I saw that in “upbge” it is possible to use the object color as input data for a node-based shader (add->input->Object Data->color), so different objects that share the same mesh can have different colors.
How can I do the same thing with a shader coded in glsl?