working on calcColorPurity