What am I?

I am black when you buy me, red when you use me. When I turn white, you know it's time to throw me away. What am I?