A method of preventing post-operative endophthalmitis involves injecting a colored antibiotic solution into the anterior segment of the eye during surgery, the antibiotic solution having moxifloxacin, cefuroxime, vancomycin, or some combination thereof, and the coloring agent being preferably a cobalamin (e.g., cyanocobalamin).