Created the function writeColor(std::ofstream&) to write the color to a file