Computing a scalar from UV coordinates in Cycles nodes
You can get the UV coordinates from a Texture Coordinates or from an Attribute Node, separate the three components of the vector using a Separate RGB node, and use this to map colors to your BSDF.