There is no 'intelligence' at all, however; Dawkins explains the evolution of eyes in the blind watchmaker;
http://www.youtube.com/watch?v=aGFR-kFi0c8
It's an excellent question.
The ability to see colours depends on the 'spectral range' of the sensitivity of the light sensitive cells at the back of the eye, the genes that hold the information on how to build light sensitive cells are called 'opsin genes'
It turns out that 99% of all mammals only see two colours, and are known as dichromats, only a tiny subset of the great apes (including humans) have evolved the ability to see three colours (trichromats)
It's thought that the mechanism that induced this, was a duplication in the the opsin genes, which created more light sensitive cells, followed by a point mutation of the gene which meant the additional cells were sensitive to a greater range of colours.
This means that a monkey in the jungle, surrounded by green foliage would suddenly be able to see bright yellow bananas where it wouldn't have before, giving it an enormous survival advantage. If it's a male who reproduces and that gene gets passed into offspring, there's a chance that they too will see in three colours, it goes on and on until they become very successful.
So what was a chance occurrence of totally random mutation, was 'selected' naturally upon expression, resulting in an improvement, which ultimately goes on and on.