Well, they are mostly some kind of yellow, orange, red or purplish.
This is supposed to be because they are there in order to attract animals to eat them and disperse the seeds, and such animals (birds, monkeys etc) usually have good colour vision. Those colours stand out against the general green of leaves. This idea is supported by the way most fruits are green until ripe.
Some fruit are other colours. The European spindle (Euonymus europaeus) we get in the hedges here has berries which are an awful clash of shocking pink and luminous orange. Ugh.
Many berries are poisonous -- but never to the target animal.
Why are they not all the same colour? Perhaps because having a somewhat different colour allows the target animal to develop a "search image" for that species alone. A European blackbird, for example, might spend the whole day eating, say, the dark reddish berries of a hawthorn, another day on the more orangy berries of the whitebeam, and another on the squishy black berries of a blackberry.
What I don't know is why toadstools are often bright colours -- birds and mammasl generally don't eat those (except me of course)...