writemime function fors colors and arrays of colors