Need some help on applying gradient based on multiple curve offsets!

Currently trying to show each road that will have a colour gradient change as it goes further out! But I can only manage to get it to go purely based on the xyz value! Does anyone know what I am missing out on?