The MixRGB node has two color inputs and a drop down menu, as well as the Factor input.
Each entry in the drop down menu selects a function that is applied to the two inputs to produce the output. In some cases, the Factor input is used in the equation to control how much of the affect is applied. In other cases it is ignored.
Here are some examples, using $a$ for the top color, $b$ for the bottom color, and $fac$ for factor
- Mix: $a + (b - a) * fac$; Most useful for using a mask as the factor to select between an image versus a background color;
- Darken: $min(a, b)$;
- Multiply: $a * b$ [ie, $a_r * b_r$, $a_g * b_g$, $a_b * b_b$];
- Color Burn: $1 - ( (1 - a) / b)$; can be used as to do things like setting the width of mortar. Set $a$ to a gradient (IE, the X coordinate, Set $b$ to 0. Then color burn effectively goes black from 0 to factor and then is a gradient from factor to 1. NOTE: always clamps to [0..1]
- Lighten: $max(a, b)$;
- Color Dodge: $a / (1-b)$; the opposite of color burn Does not clamp the negative [-inf..1]
- Add: $a + b$; useful for layering displacement maps.
- Linear Light: $(a + 2*b) - 1$; Factor is important to this; but the big thing is that you can use it to add noise and control the noise. Put the noise in b. The basic shape of a doesn't change but factor acts to attenuate the noise. It's a good way to add noise to coordinates.
- Difference: $abs(a - b)$
The Mix Shader node has two color inputs but no drop down. It uses the same equation as the Mix mode of the MixRGB node.