Why are vegetables either red or yellow?
A lot of fruit and veg are green when unripe and become brightly coloured when they are ready to eat (obviously not true for all, but most fruit/veg does).

This is probably deliberate as a mechanism to signal to birds and animals that it is ready to eat, so that they can disperse the seeds inside. 

Red and Yellow are bright colours not usually seen on plants except of fruit/veg, and flowers (which are brightly coloured to attract bees and whatnot), so it makes sense these could be used as signals.

http://www.rosincerate.com/2015/07/colour-changing-fruits-and-veggies.html