How to color object based on roughness?
One approach to this might be to use Dynamic Paint and Vertex Colors to create a proximity map between your surface, and a smoothed version of it. I imagine this will be for visualization and illustrative purposes, there's nothing calibrated about it. The method assumes quite high vertex density.


Derive a base surface, from which, heights will influence color


In this example, I used AltS to scale the original mesh down along its surface normals, and a Smooth Modifier. (The smoothed object you can see in the illustration is a copy; the one actually used is inside the original mesh. If you make your copy an instance using Alt D, the you'll be able to adjust it conveniently, while viewing its effect.)




Under the physics tab of the properties panel > Dynamic Paint, make the original mesh a Canvas, with settings as shown:




(.. you have to click the '+' next to the 'Paintmap Layer', to create a Vertex Color layer in the object)


Under the physics tab of the properties panel > Dynamic Paint, make the smoothed mesh a Brush, with settings as shown:




(You will have to tweak the 'Paint Distance' parameter, in particular, to get a good range of tones.)


Give the original mesh a material whose color is influenced by the tones in the Vertex Color layer, here left with its default name of 'dp_paintmap' (As you can see I haven't set the range of tones up perfectly, here)




and this is the sort of result:



Other options include combining this map with Sharpness as suggested by Duarte, or inverted normal Ambient Occlusion, to emphasise higher frequency (sharper) surface details, or thinner protrusions.