Write MMCQ(https://github.com/lokesh/color-thief/blob/master/js/color-thief.js) in python