Blending custom depth layers in Post Processing

Hey!
So I am using the custom depth node in a post processing material. Working super nice for some effects but I am struggling to figure out how to get a soft fade between. If i use an If node then there is always a harsh line between the different depths, and I would love to find a way to have a smooth fade between! Below is a picture of the example with one part of the image desaturated and the rest normal. And then the node tree for my PP material!
Any help would be greatly appreciated!
Cheerio