From Food Insider:
Rainbow cake sprinkles have been around since the late 18th century, when French candy chefs used them as decorations. Today, liquid food coloring, shortening, and sugar are mixed in hot water to form the sprinkle's colorful dough. Long strands of the dough are broken into the tiny shapes we see on cakes, doughnuts, cookies, and ice cream.
(via Laughing Squid)