Coding for "arrange by color" feature.