What am I?

I spend most of my day eating white. When I am quick enough I get rewarded with fruit and something blue. In a dark room with blue walls I run from the ghosts that roam the halls