led analyser for pcb functional test
This type of test is commonly done to ensure that the PCBA manufacturer populated the board correctly. This means that they put red LEDs where the red LEDs belong, and the correct brightness is achieved from the LED. I've used RGB sensors like that one previously; the only issue is that they don't have configurable I2C addresses so if you need to measure a bunch of LEDs then it's more difficult. But they're nice because they give you intensity of RGB and clear.

In production you'll want to turn on the LED, wait a millisecond or so for it to settle, and then read the color values. Compare this with a known good board and you will know whether the device is working correctly or not. 

There are also integrated solutions like this one, which may be easier if you don't need to build a ton of them:
http://www.finntestelectronics.com/product/smart-finn/