Is it possible to make gradient colored glass?

I’m not a professional in creating materials but I was wondering if it was possible to have a glass material with multiple colors by means of gradients.

Here is an example image where it is done in blender.

If this is possible please let me know.

It’s probably not difficult.

Gradient

Material Function Reference