Color calculation bug fixed