Material cutoff / opacity mask? (in a node)

Hi, so I’m trying to achieve a sort of cutoff based on texture color. I would like it to work similarly to the opacity mask, but in a node instead, so I can just add orange spots onto a material.


In the above example, I send in a texture, then anywhere that is over 0.5, will output the orange material, and anywhere below outputs the black material.
Of course this doesn’t work because the ‘if’ node requires a float.

Is there any way to do this?

For example, the orange could be snow, and it would appear randomly based on the input texture and the 0.5 number.
Right now the only way I see to do this is the Opacity Mask, but I would like it in a single node.

Any thoughts? Thanks! <3

Figured it out. By adding a decimal and flooring it (or subtract and ceil) you can get solid colors of an image

Which when paired with Opacity Mask, can give a nice dissolve effect.