Add comments to the replaceColor function