Studio Yotsuba
Back to Node List

Value Match

value_match

Checks whether two values match, based on the selected type

Reviewed
Guide available

Input Ports

NameTypeDescription
A
a
Number
Required
First value to check
B
b
Number
Required
Second value to check

Output Ports

NameTypeDescription
Result
result
Bool
Match result

Parameters

NameTypeDefaultRangeDescription / Options
Value Type
value_type
Enum
Number—

Choose what kind of values A and B are

  • NumberNumber
    Compare two numbers
  • BoolBool
    Compare two boolean values
  • TextText
    Compare two text values
  • ColorColor
    Compare two colors
Number Check
number_mode
Enum
Same—

Choose how to check the numbers

  • SameSame
    True when |A - B| is less than 1e-9
  • DifferentDifferent
    True when |A - B| is at least 1e-9
  • AlmostSameAlmostSame
    True when A and B are close enough
  • NotAlmostSameNotAlmostSame
    True when A and B are farther apart than the tolerance
Tolerance
tolerance
Float
0.010–1000 / step 0.001

Allowed difference for almost-same checks

ON/OFF Check
bool_mode
Enum
Same—

Choose how to check the ON/OFF values

  • SameSame
    True when A and B are both the same
  • DifferentDifferent
    True when A and B are different
Text Check
text_mode
Enum
ExactSame—

Choose how to check the text

  • ExactSameExactSame
    True when both texts match exactly
  • ExactDifferentExactDifferent
    True when the texts are different
  • IgnoreCaseSameIgnoreCaseSame
    True when the texts match ignoring letter case
  • IgnoreCaseDifferentIgnoreCaseDifferent
    True when the texts differ after ignoring letter case
Color Check
color_mode
Enum
RgbASame—

Choose how to check the colors

  • RgbASameRgbASame
    True when color and alpha both match
  • RgbADifferentRgbADifferent
    True when either color or alpha differs
  • RgbSameRgbSame
    True when RGB matches and alpha is ignored
  • RgbDifferentRgbDifferent
    True when RGB differs and alpha is ignored

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 ordering
  • switch / gate — destinations for the result
  • expression_bool — write compound conditions as an expression

Per-type usage

Number

  • Equal
    • Returns true when |A - B| is less than the fixed threshold 1e-9.
  • Not Equal
    • Returns true when |A - B| is at least the fixed threshold 1e-9.
  • Approximately Equal
    • Returns true when the difference between A and B is at most Approximate Tolerance.
  • Approximately Not Equal
    • Returns true when the difference between A and B is greater than Approximate Tolerance.

ON / OFF

  • Equal
    • Returns true when A and B have the same state.
  • Not Equal
    • Returns true when A and B have different states.

Text

  • Exactly Equal
    • Returns true only when the strings match exactly.
  • Not Equal
    • Returns true when the strings differ.
  • Equal Ignoring Case
    • Ignores differences such as Fire versus fire.
  • Not Equal Ignoring Case
    • Returns true only when the strings still differ after ignoring case.

Color

  • Same Color and Opacity
    • Returns true only when all RGBA components match.
  • Different Color or Opacity
    • Returns true when either color or opacity differs.
  • Same Color Only
    • Compares only RGB and ignores opacity.
  • Different Color
    • Returns true when RGB differs, ignoring opacity.

Notes

  • Select the type before using this node.
  • Use Compare for numeric ordering.
  • Numeric Equal / Not Equal use the fixed 1e-9 threshold and do not read Approximate 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

  1. Connect Text Input("Fire") and Text Input("fire"), then set Match Type = Text, Text Match = Equal Ignoring Case.
    • Treats Fire and fire as the same.
  2. Connect two Color Input nodes, then set Match Type = Color, Color Match = Same Color Only.
    • Returns true when the colors match even if their opacity differs.
  3. Connect two Number Input nodes, then set Match Type = Number, Number Match = Approximately Equal.
    • Treats slightly different values as the same.
  4. Connect the Value Match result to Switch.
    • This is the basic pattern for conditionally switching images, colors, or strings.
Back to Node List