Solid colored shapes and vertex colors

I am trying to find the most efficient way to create shapes that have a solid color on the body and an specified color on the edge. For example, a cube is colored in gray, but all the edges are yellow. Another cube has a magenta body color and blue edges.

I cannot use textures as the colors are decided at run-time. I have been looking at the material tutorials without much success. Is it just a matter of defining the right material? Should I write my own shader or jME has the right shader for this job?

Any help is appreciated!

The lines are one mesh and the faces are another. If you use the same mesh for both geometries then you will see triangles for a cube instead of squares.

…you definitely need two separate geometries and two separate materials. One geom + material for the solid shape and one geom + material for the wire frame.

Unless you don’t care so much about the quality. Then you could use a texture and just build it an runtime.