Capturing the color of the sky

Not all color sensors are born equal.

I spent 10 times more time in coding one than planned, after days of struggling to code another one, which refused to work for misterious reasons. The second one did work, but proved to be useless in practical terms, since color recognition of a plain surface few centimeters in front of the sensor did not make any sense for me.