I can be white or dark, I am sweet and sometimes bitter and you see me on a cupcake or in a cookie. What am I?

Image of Riddle Question

Can you solve this riddle without clicking that tempting answer button?