The Google feature offers 12 colors with which to match images. So I would calculate the Lab coordinate of each of these swatches and plot the L*a* coordinate of each of these colors on a two dimensional space. I'd drop the B component because brightness of the pixel should be ignored. Using the 12 points in the L*a* space, I'd calculate a partitioning using a Voronoi Diagram. Then for a given image, I'd take each pixel, calculate its L*a* coordinate. Do this for every pixel in the image and so build up the histogram of counts in each Voronoi partition. The partition that contains the highest pixel count would then be considered the image's 'color'.
This would form the basis of the algorithm, although there would be refinements related to ignoring black and white background regions which are perceptually not considered to be part of the subject of the image.