Just to clarify, which are you trying to get?
- a grayscale value for your color input, e.g. colors become gray? or…
- a masked version of your input, where only values are passed through if the masking color is exactly black or exactly white at the corresponding texture coordinate?