This happens when the juice from the raspberries is mixed into the dough before baking. The raspberry juice can react with the baking powder in the cookies and turn the dough blue. The cookies may also be a little gray. To avoid this, make sure to use frozen berries that will not have as much juice.