What is it for?
- When you want to check whether two strings are the same
- When you want to check whether two colors are the same
- When you want to check whether ON/OFF states match
- When you want a simple approximate-equality check for numbers
Overview
Tests whether values, including non-numeric ones, are the same or different.
compare handles numeric ordering, while this node handles text, color, and
ON/OFF equality plus approximate numeric equality with a tolerance. Send the
resulting Bool to switch / gate.
Usage tips
- A useful rule is: ordering (
>,<) =compare; equality or inequality = Value Match. - The most practical options are approximate equality (for floating-point rounding errors) and same color (compare colors while ignoring opacity).
- Color tests work well with palette workflows. You can branch on a condition such as "if this pixel has the same color as palette index 2."
Related nodes
compare— numeric orderingswitch/gate— destinations for the resultexpression_bool— write compound conditions as an expression
Per-type usage
Number
Equal- Returns
truewhen|A - B|is less than the fixed threshold1e-9.
- Returns
Not Equal- Returns
truewhen|A - B|is at least the fixed threshold1e-9.
- Returns
Approximately Equal- Returns
truewhen the difference between A and B is at mostApproximate Tolerance.
- Returns
Approximately Not Equal- Returns
truewhen the difference between A and B is greater thanApproximate Tolerance.
- Returns
ON / OFF
Equal- Returns
truewhen A and B have the same state.
- Returns
Not Equal- Returns
truewhen A and B have different states.
- Returns
Text
Exactly Equal- Returns
trueonly when the strings match exactly.
- Returns
Not Equal- Returns
truewhen the strings differ.
- Returns
Equal Ignoring Case- Ignores differences such as
Fireversusfire.
- Ignores differences such as
Not Equal Ignoring Case- Returns
trueonly when the strings still differ after ignoring case.
- Returns
Color
Same Color and Opacity- Returns
trueonly when all RGBA components match.
- Returns
Different Color or Opacity- Returns
truewhen either color or opacity differs.
- Returns
Same Color Only- Compares only RGB and ignores opacity.
Different Color- Returns
truewhen RGB differs, ignoring opacity.
- Returns
Notes
- Select the type before using this node.
- Use Compare for numeric ordering.
- Numeric
Equal/Not Equaluse the fixed1e-9threshold and do not readApproximate Tolerance. Choose an approximate mode only when you need a configurable tolerance. - For text comparison that should ignore uppercase / lowercase, change
Text Match. - To ignore opacity in a color comparison, use
Same Color Only/Different Color.
Examples
- Connect
Text Input("Fire")andText Input("fire"), then setMatch Type = Text,Text Match = Equal Ignoring Case.- Treats
Fireandfireas the same.
- Treats
- Connect two
Color Inputnodes, then setMatch Type = Color,Color Match = Same Color Only.- Returns
truewhen the colors match even if their opacity differs.
- Returns
- Connect two
Number Inputnodes, then setMatch Type = Number,Number Match = Approximately Equal.- Treats slightly different values as the same.
- Connect the
Value Matchresult toSwitch.- This is the basic pattern for conditionally switching images, colors, or strings.