Here are my first thoughts on the project design:
The candy will drop one by one from a container. For the moment, I don't know if I will be able to separate the candy without a mechanical system. I've seen a few designs already, but maybe I will have to make my own to get the speed I'm looking for.
Then gravity will push one candy down the main channel where it will drop in front of a camera. The camera will provide a high speed color detection without having to stop the candy during its fall. I don't expect the algorithm to be too difficult, at least the first naive version, since only the color needs to be detected. And to keep it simple, one of the first requirements will be that only one candy can be in front of the camera at a time. For the platform I'd like to use OpenMV, a Raspberry Pi with camera module could be a good alternative.
To separate the different colors, I plan to use compressed air. A compressor will provide a continuous stream of air. Solenoid valves, controlled by the color detection software, will release the stream that will push a candy into one of the side channels. The timing will have to be precise to catch the candy during its fall.