Camouflage hides shapes by generating hints of many other possible shapes. Instead of staying silent, in other words, camouflage succeeds by being noisy: it hides signal with noise.
Source: http://www.aiga.org/the-art-of-camo/
The problem with the UCP, Cramer says, is the coloration. The Canadians were the first to use a pixelated camouflage, also known as digital camo, with sharper edges that help fade into the background. “You can’t look at camo from five feet away and see that, but once put it out in the bush up to 30, 40, 70 yards, it works much more effectively,” he says.
UCP was a later iteration of the pixelated camo, but instead of relying on a group of colors that would fit a specific environment — desert, woodland or transitional — the pattern was made of foliage green, urban gray and desert tan. “You can’t just take a mishmash of different colors, mix it together and assume you’re going to have a universal pattern that will work everywhere,” he says. “The army has decided this time around everything is going to be based on as much scientific testing as they can.”
Cramer takes the specifications — the colors and the setting — and plugs it into a graphic design program that he has heavily modified with his own algorithms. He uses a core set of 14 to create different combinations of colors and patterns, tinkering the algorithms along the way to see if he can improve upon his earlier designs.
Source: http://www.wired.com/2012/06/how-hyperstealths-algorithms-build-better-camo/
Quantum Stealth is a material that renders the target completely invisible by bending light waves around the target. The material removes not only your visual, infrared (night vision) and thermal signatures but also the target’s shadow.
Two separate command groups within the U.S. Military and two separate Canadian Military groups as well as Federal Emergency Response Team (Counter Terrorism) have seen the actual material so they could verify that I was not just manipulating video or photo results; These groups now know that it works and does so without cameras, batteries, lights or mirrors...It is lightweight and quite inexpensive. Both the U.S. and Canadian military have confirmed that it also works against military IR scopes and Thermal Optics.

Source: http://www.hyperstealth.com/Quantum-Stealth/index.html
As far as what the algorithms are and how to create it -- no clue. I'll definitely be looking into this more later though and will edit if I can find anything. It sounds like a lot of the more advanced patterns are very hush-hush to the point of being silenced by the government to prevent the technology from getting into the general public. Color absolutely plays a role though. The military has long used color blind people as spotters because of their ability to see fortifications through camouflage. My grandfather was one of them. My cousin while not in the military inherited that gene and living in San Diego was able to see parts of the military base that his friends couldn't.
There's a somewhat relevant discussion about this aspect on the Skeptism Exchange: skeptics.stackexchange.com - Do Colour Blind People See Through Certain Kinds of Camouflage?