Gradient across object:
We can map a gradient to generated texture coordinates on the joined object to smoothly display a gradient on the surface of our mesh.
You may also choose to make a material that has the gradient mapped to the height of the object. This method allows for each lego brick to be an idividual object as long as the have the same origin. The drawback of this method is that when transformed(scaled, translated, or rotated) the gradient will remain the same and not move with the objects transformation.
Post on Auto-Smooth:
I believe the problem you're encountering is not a material or UV issue but rather a modeling issue. Blender is shading the whole object as if it was smooth not retaining sharp edges. This is what is adding this specular highlight in the middle of your faces. By either using custom normals, marking sharps, using auto-smooth, an edge-split modifier, or a combination of these techniques, you can define and preserve what you want as sharp edges.
One of the easiest and most convenient ways to achieve this is auto-smooth which the Blender manual describes as
Edges where an angle between the faces is smaller than specified in the Angle button will be smoothed, when shading of these parts of the mesh is set to smooth. This is an easier way to combine smooth and sharp edges.
The edge-split modifier works very similar but it actually 'rips' the edges from one another according to given angle.