Relax it first. If you color it first the chemicals of the relaxer will strip the color out. Always follow the recommendations on the box, they know how to keep your hair from falling out. I use a hair coloring for professionals and color my hair one to two weeks after relaxing my hair. I've done this for a year with no problems whatsoever.
You should relax it first, but remember you should wait AT LEAST a month before you dye it or your hair will fall out. It's actually a bad idea to relax+dye, but if you must remember to wait a month. :) -- Sisii