How the Color Sensor Works

The idea is quite simple. The sensor consists of a grid of color-sensitive filters and a sensor array underneath, as shown on the picture below:

Each filter passes light of only one color to the sensor below. A single pixel is constructed out of 4 filters: blue, red, and 2*green. There are twice as many green filters to mimic the physiology of the human eye which is more sensitive to the green light. The signals from the sensors allow us to calculate the RGB values of each pixel describing it's color in terms of the green, blue and red components.