How to find average colour of television

I seem to remember another Arduino ambilight project, but I suspect the colour detection was done elsewhere.