Gradient mapping in shader graph

so i have a greyscale image and a gradient map and i want to make it work like the example , so how do you do this in shader graph ?

A gradient map fundamentally uses the brightness of a pixel as coordinates for reading a gradient texture.

The most straightforward way to do this would be to sample your grayscale Morty Head texture, pull a single channel from it (the green channel is frequently the least compressed), and use that as UVs for sampling your brown gradient texture.