# How does Color Mix (Difference) node work?

How does the above node setup work, and what will happen when I change the Fac value (0-1)? What calculation is the mix node doing here when set to Difference?

The Mix RGB node, when set to difference, returns the absolute value of the first color minus the second color. Mathematically: Color = |Color1 - Color2|.
The Fac value controls how much this influences the output. So if Fac is 0 the output is always Color1, if Fac is 1 the output is always the exact result of the mix operation chosen (in your case, Difference). It basically just mixes Color1 back into the result of the operation. Mathematically: Color = |Color1 - Color2| * Fac + Color1 * (1-Fac).