I'm currently trying to do this for my own side project, my current plan was analyse each photo using one of the many color analyser algos out there (color-thief seems to be popular/efficient), but the problem is, color is a very complicated thing to compare. I think euclidean distance for two LaB colors is the best for complexity to result ratio (and RBG to LaB is an easy/well-solved problem).