You do not need to read or understand anything of this in order to use ColorSwap. But you might find it interesting.
This is the RGB color space:
And it is commonly used by TV's, computer monitors and computers to represent and produce color. It is not very helpful in item isolation based on color.
Red color channel
Green color channel
Blue color channel
Turn them all on 100% and you get white, turn them all off and you get black.
This is the HSV ( Hue The color without respect to saturation and lightness , Saturation The amount of white mixed in to the color , Value) color space. HSV is a color model that defines colors based on their Hue (kind of color), Saturation (amount of color) and value (amount of white mixed into the color).
It is a much better calculation base for the algorithm of ColorSwap. And this is what we use.
Why is HSV better for ColorSwap than RGB? HSV acts like our own perception. If we put a single colored object partly in the light, it will have an endless amount of RGB-colors in it, but in HSV it still has one Hue and the lightness or value of the HSV color space changes. This maps more to how we perceive; that the object has the one color but it is hit by different light.
Hue is what the color is. This tells where along the spectrum your color lies. This value wraps around 360 degrees, starting and ending in red colors.
Saturation can be thought of as how pure the color is. Greater values (less white) in the saturation channel make the color appear stronger. Lower values (more white) make the color appear very washed out.
Value is how bright the color is. White values in this channel have the maximum brightness, black values have no brightness at all.