How I can choose the needed color from texture?

It’s working now, are you just clamping those particular colors? I wonder how much more expensive it is than doing using a 5 layer mask with RGBA.