Orientation-based texture color

Greetings interwebs!

I have a question, folks, and it’s been bothering me for a while. Is there any way to apply a color value to the texture of a UVmapped model, based on the orientation of its surface normals? Now, don’t be hasty. Let me explain.

Imagine you have a UV sphere, or similarly curved surface. What I want is to have the texture vary in color from black through shades of gray to white, based on each surface point’s orientation on a certain axis. Every ‘meridian’ of the sphere, from the poles to the equator, for instance should be the same shade of gray - and it should be a unique shade of gray, not used by any other meridian. And I should be able to bake that information on a texture - sort of an ‘azimuth-map’ thing.

Any ideas?

I am not quite sure what you are asking, but I think you want ramp shaders, or color ramps.