Logic gates

Hello everyone,
Just started grasshopper, and i’m stuck understanding how logic gates work.
I have some solids. Then extract surfaces and check 2 biggest surface areas if equal. if true i need to do one thing, if not, other. But when i select surfaces that can go true and false, i get error. How i should make a gate if-then, expression only seems to work with numbers/text, i cannot “pass” surface though logic gate.

Or simpler example, lets say, there are 3 colored surfaces, if color is red, i need to offset 1mm, if green 2, if blue 3mm. How should i make, if red = true, do 1(and even in same “loop”, right now it gets true and false inputs at same time)

Okay, sorry for duoble post, but “dispatch” was the function i was looking for, after trying stream gate, expressions, and python just to find out they didn’t help.

If at all possible, I’d recommend the Sift component instead. Dispatch and Stream Gate are earlier attempts at doing branching logic and they have serious shortcomings.

Sift supports a variable number of outputs if you need more than two, and it keeps nulls in those outputs where the values didn’t go. So if at any point you need to merge the separate data streams into one again and regain the original ordering, you can do so easily with the Combine component.

The Sift/Combine pattern is the closest you’ll get to an if or switch statement in Grasshopper.

Thank you David!
Sift help, Dispatch even though didnt gave error, it only gave single output and not “stream”.