color repaint function complete