Function to quantize the color level

* Learnt in Coursera. =)