While adding food coloring or other dye to dry ice or a commercial fog machine may be tempting, it's more likely to ruin your fog machine than to color the fog. The particles of coloring are too large to be dispersed into the fog, so no matter how much dye you add, the fog will still roll out white or clear. The only way to really make a colored fog solution is by lighting the fog with colored lights. The fog then reflects that light, appearing to take on the same color itself.
Prepare and run your fog machine as normal. This includes positioning a fan to blow the fog in the desired direction.
Place your movable spotlight so that its beam intersects with the flow of the fog. If you need to color a long stretch of blowing or moving fog, you may need more than one spotlight to cover all of it.
Cover the aperture of the spotlight with a sheet of colored plastic in the same color you'd like the fog to be. You can use heavy plastic like sheet dividers or transparency sheets and tape it in place around the edges with duct tape, or you can also affix colored plastic wrap across the front of the spotlight.
Shine the spotlight on the fog and adjust it, if necessary, to make sure the beam of light is hitting the fog.
Watch the spotlight carefully for signs that it is melting the colored plastic covering. You might need to replace the plastic occasionally.
The chemicals from commercial fog machines may be hazardous in enclosed spaces. Similarly, the carbon dioxide produced by melting dry ice in a homemade fog machine may present problems in enclosed areas. Make sure that your working or performance area is well ventilated. Watch crew members carefully for faintness or other signs of distress.