Color matching and recipe prediction is one of the most important aspects of color science. In this article, a new method using ant colony algorithm is developed to optimize the color formulation step. Four direct dyes, namely CI Direct Red 227, CI Direct Orange 34, CI Direct Blue 85, and CI Direct Black 22 were used and mixed to dye cotton fabrics. The aim is to reproduce the desired shades by determining the dyes and their respective concentrations to add in the dye bath. The criterion of optimization is to minimize the CMC color differences between the target color and the color obtained by the proposed recipes. The developed algorithm showed good performances with small color differences all lower than the unit.