What is the mechanism of color sorting machine?
You would need a lot of mechanisms for sorting parts by color.
For starters, you are going to need a machine that is physically capable of sorting the individual parts. This could be through the use of conveyors, flaps, steppers, the possibilities are pretty open ended.
Secondly, you are going to need the electronics part of the problem. A vision system is going to be required to locate, identify, and send the gathered information to the PC.
We used a Keyence system to inspect and sort cable tie connectors.