Color Detection possible?

Hello All,

Currently making a music project that will, in theory, play sounds based on detected colors a webcam can see.

I’m certain this is possible in either AS 2 or 3 - but unsure exactly how.

I’ve searched the wonderful nets for a tutorial or an example of this being done with flash but have come up with nothing.

Is there any tutorials for detecting colors and then responding to them? (All as viewed by webcam, so in real-time).