K-means clustering algorithm for RGB color