A color sensor detects the color of an object by measuring the intensity of light reflected in the red, green, and blue wavelengths. It works by emitting white light and using filters to measure the light reflected in the red, green, and blue wavelengths separately. Common applications include grading colored products, detecting markings, and controlling RGB LEDs. The color sensor can be easily interfaced with an Arduino board to read and interpret the RGB values.