Ding's updated color algorithm