it's a really complex problem here. basically, figure out how to do this steps.
1. make arm
2. make soft to position polar arm in rectangular coordinates (hint hint inverse kinematics)
3. make grabber. i'm not sure how that would be, since you are allowed with only two servos. electromagnetic perhaps?
4. test this from computer software, you can move the arm and grab/drop things around
when these are done, the final software, to sort them could look like this
1. decide where the candy piles are. it's easier to move them all to an empty space then to decide "where" are more and "where" is the red pile, f.i.
2. move the arm out of the pile, where the candies are.
3. check if a candy can be seen
4. look at candy color, grab, move arm to required pile, drop
5. repeat from step 2, if step 3 fails, end
edit: as for the actual design, two servos are good enough to design an arm, but you will also need some acuators for the griping mechanism