You can use the math node “greater than”, you just need to add another colour value to your colour ramp. Here .5 (grey) is greater than .4 and 1 (white) is greater than .6
I could have put thresholds of any value from 0.001 - .499 for grey or .501 - .999 for white. If you add one more decimal it would be rounded and will not work.
Exactly.
You are using the colour ramp to assign a value. The positions of the slider determine where those values are assigned on the textrure coordinates.
In this case I have 3 values black (value 0) grey (value .5) and white (value 1).
You could add more shades of grey and have more values.
The greater than node reads a “map” of values. The map is determined by the “factor” of the color ramp (wave texture) and the positions of the sliders. The values are determined by the colour value which for pure grey is the value in the HSV (H=0 S=0 V=0.5) is the same as (R=.5 G=.5 B=.5).