Is there any sort of way in Cycles to simulate what node "Shader to RGB" does for Eevee?

That is accepting closure (green) input and outputting it as color (yellow)?

BTW I am not using Blender, just a separate renderer called Eyesight which is build upon Cycles renderer, thus what I would like to see is some solution in "one go" made out of nodes that are accepted in Cycles.