rewrite using zenozeng/colors-clustering