Smooth Falloff?

Hi everyone, hope you’re all doing well!!

I’m working on a project that evolves clipping colors in an image into a range.
But I’ve come across a little problem.

This is the code for the color range:

if (image.x > low && image.x < high) { 
   image.x = 0.0;

But the falloff is VERY rough.

Is there any way to make the falloff of this smoother?
Maybe even make a variable that decides how smooth the falloff is?

I would really prefer to do this without any blurring.
Any ideas?

Thanks in advanced,
Shem Namo

Look at the smoothstep() function in the GLSL Spec. By contrast, check out the step() function.