I am in need of a way to remap a color range. I have an image with a blue background, and a white line on top of it that fades out to blue towards the bottom. My goal is to remap a range of from [solid Blue to solid white], into [white (0% opacity), to white (100% opacity)]. This would leave me with nothing but a white line that fades to transparent, as if the blue background was never there in the first place. Note that I have other uses for this functionality as well, so I am not just asking if Photoshop already offers a way to extract transparency.Preferably, I'd be able to click a button, input an in range, an out range, click Apply, and have it remap the colors of my layer permanently.Even i saw adobe brand explainer video but i didn't get right direction. I played around with Extendscript Toolkit for a few hours, but it doesn't seem like it offers what I need in the form of a script.

I constantly find myself needing to remap ranges like this for the type of art I do, and am just curious as to what I would use to pull this off. Capabilities available in filters would work, but there is no filter to do this, so I am looking to create my own. Hopefully someone can point me in the right direction!