Dominant color may refer to many things. There is no one formula for getting this value. As such there is no better method, unless you can define what better in your use case means. Since your not providing a use case they are all as good.
The real problem is that a human sees colors differently than a computer take this illusion:
Image 1: Our brain interprets the B tile lighter than A tile even tough they are as dark. Illusion source, with deeper explanation.
Just doing a naive color search is going to fail. Calculating the most common color would fail in many cases because the image may have lot of slightly discolored hues of same color, because of noise. So the colors have to be binned with some metric, finding these bin cluster centers isn't really a straightforward deal.
Image 2: What is the dominant color of this image? Black 0 0 0 pixels are the most common if you'd just calculate their number. Humans would still say green is most dominant.
In addition the computer should be able to eliminate the effect of light and shadow on the surfaces of the image as this is what human eyes do anything other feels somewhat off. So you should boost the color a bit. How much is a hard to say you would need complex heuristics.
As a result theres no right solution to the problem. Certainly looking at minute differences in RGB values is a bit over the top as most humans can not recognize those colors as different unless they can compare them next to each other. So for all intents and purposes for humans thse represent the about the same color.