To provide a recorder capable of eliminating color mixing due to purging even when the purging is executed without the order of lightness of ink.
When purging of a head for a black ink is executed (step 120) and purging of a head for a yellow ink is executed (step 130), the black ink stuck to a suction cap enters from a nozzle of the head for the yellow ink so that the black ink is mixed with the yellow ink. However, when 5000 times of preliminary ejection operations are carried out in flushing after the purging (step 150), the mixed ink is discharged therefrom. The number of times of preliminary ejection operations is increased as the lightness of ink is higher. As a result, it is possible to eliminate the mixture of inks even when the head for the ink having low lightness is purged earlier than the other.