To implement this color detector, we collected data using a Terasic digital camera with GPIO interface connected to a DE1_SoC board. We then process the data collected by performing a running average of the red, green, and blue elements on the screen and analyze it to determine the primary color captured by the camera module. (Test)
Verilog driver code generated by Terasic System Builder.
GIF showing how it works: