What's the fastest way to caculate 1 main or average color from frameBuffer?

what’s the fastest way to caculate 1 main or average color from frameBuffer?