Basic RGB question

Hi, I've been tinkering with the "RBG LED Color Chooser" from the playground, and there's something I don't understand. The circuit feeds 5v to the led anode, but then , against my very limited knowledge, current doesn't go to ground through the catodes. Instead, the program seems to be feeding 5v to the cathodes. Obviously, I'm wrong, because it works as intended, but I'd like to know what is going on, so I can build on this knowledge. Thanks! ducho

Perhaps the I/O pins are sinking current to ground... Just a thought.

Notice the inversion of the expected (positive logic) PWM signal using the "255 - mapped_pot_value" in the analogWrite.

Thanks awol