The Python script uses KMeans clustering algorithm to extract the 8 most dominant colors in the image shown below.
After applying the KMeans clustering algorithm the following results are observed:
But these dominant color boxes are in random Order. After writing a loop to arrange them in the order of the most dominant colors we observe:


