How to get color or value from material with shader?

I have a sphere with a shader that is using perlin noise with colors for specific heights and I want to get the height or color of the point the mouse is on when clicked. Is there a good way to get this information or the whole texture and find the value that way?

You can use Unity - Scripting API: RaycastHit.textureCoord to get the UV of the texture at a clicked point and look up the corresponding value from the texture.