Under different conditions, the MgO crystals were electrolytically colored with a homemade electrolysis apparatus. A lot of F, F2 and some unknown color centers were produced effectively in the colored crystals. The formation mechanism of the color centers was presented. Systematic spectral measurements were carried out to the colored crystals, the parameters of the absorption spectral bands of the color centers were determined, and the formation procedure of color centers were analyzed. Research results show that the concentration of the color centers increases with voltage rising and time extending, and in the electrolysis, various color centers were easily and efficiently obtained through a single-step procedure without complex treatment used in the other coloration methods, which shows that the electrolysis has bigger practicability.