How do i get Simple Objects with clear edged colors?

Hi i want to have simple Objects like Cubes where i can see clearly the edges.

Like in this example of a Processing Sketch.

I tryed, to use, point or Directional Light, but than i have a gradiant depending on the Light Position or Direction.

I also tryed to only set the Ambient Light, but than the Edges of my Cubes Disapper, becouse every Side of my Object has the exact same Color.

Does anyone have an idea?

You will have to use a special shader for this. To get black edges you could try one of the shaders from the toon package. If you want to write your own these may also be a good starting point.