fix color_calculation