Clever. How does it actually extract the dominant color? What kind of mathematics involved in this kind of stuff? From an architect point of view, does it make sense to do this on the client side?
The plugin uses the getImageData method on the Image object. It iterates over a portion of the pixels in an image, keeping track of color occurrences. It then returns the most dominant color and any other highly occurrent colors.