I'm not sure what you are asking. So what does your original image look like? What do you mean that you want white, black, and gray pixels?
If you use the Color Thresholder app (on the Apps tab of the Tool Ribbon) you can find thresholds to segment out a certain color, like red for example. This will create a mask where it's true/1/white where there are red pixels and false/0/black where the pixels are not red.
Attach your image and explain better if you need more help.
This is my Image. I have to extract a pair of colors (e.g. red and green), but in this case all red objects have to be white, all green objects have to be black and the rest grey. I hope it is more clear now.