Easter chicks are dyed both ways.
Some are dyed while still in the shell. They use a needle and carefully inject dye and then reseal the hole with wax. The chicks hatch out whatever color dye was injected. This method was first developed for research and identification. It had practical uses at first. That way you could track which chick was which, instead of legbands. I also read that it was used to study wild water fowl. I still have a hard time seeing a momma mallard and her raindbow colored brood. LOL The ones dyed in the shell are straight run.
I have also heard that the chicks were dipped or dunked. I'm sure this way has quite a bit more risk behind it. These I can see being the majority extra cockerels as MissPrissy stated. The larger hatcheries usually have a surplus of cockerels, so sometimes they'll dunk them and send them off to be bought and kept(for however long).
I think if I were to color any of my chicks, I would do it while they were still in the egg. The idea of dunking my new chicks into dye just doesn't seem quite right to me, but then again I have watched day-old chicks fall into their water and be just fine.
Just to be clear, the dye is injected into the egg and not the chick. So they are coloring the fluid that the chick is already in.
-Kim